Freertos / Fatfs with hot card detection
I’ve got Fatfs running nicely with Freertos, but i would like to have the ability to have hot card detection, thus if the card is removed and new one added the file system is remounted.
Hi has anyone tried doing this ? If so did you do all the card management in a task of its own ?
Freertos / Fatfs with hot card detection
Yes, I’m doing this unmount/mount based on card insert/removal.
See
FatFs with Kinetis
Arduino Data-Logger Shield with the FRDM-KL25Z Board
Freertos / Fatfs with hot card detection
Nowhere on the links is there any description on how this would be achieved
Freertos / Fatfs with hot card detection
You would have to check the sources on GitHub 🙂
anyway, for your convenience, here is the important code:
FAT1_CheckCardPresence() does the magic:
static portTASK_FUNCTION(ShellTask, pvParameters) {