Hi Christo
When the card is removed it should be adequate to call
fnInitialisationError(0);
This will set the card state to unmounted and restart the periodic attempt to re-mount it again.
In the case of card detection (insertion) it would be more efficient to stop the perioding re-mounting attempt until the card detection has occurred again - then a call of uTaskerMonoTimer(OWN_TASK, 1, E_POLL_SD_CARD); (single TICK delay) could be used to restart again, whereby it should normally be immediately mounted.
I have just prepared a new release version for one of the processor projects and have to do some tests - this may give me that chance to have a go at adding and checking the following three methods:
1) Polling SD card registers to detect removal or insertion of a different card (general case when no switch available, which presently is not working correctly from what I have heard)
2) Polling based on an input (non-interrupt capable one which could be used when a switch is available and connected).
3) Interrupt driven when switch available and comnnected to interrupt input - probably the best for quick detection and fast changing of cards so that this is not missed during polling.
Regards
Mark