• Unless things have changed, and I didn't look to see if that was the case or not, the readfile function in fs was a simple open, read, close operation. It used to do an fs init call the first time it was executed, or really the first time anything was executed.

    From what I know of how it did work, I am wondering if there needs to be an additional flag added for state change of the card.

    It would be something like:
    On idle, check the card detect pin
    If the card was present and now isnt, set the card detected flag to false and the state changed flag to true.
    If the card was not present and now is, set the card detected flag to true and the state changed flag to true.

    If the state changed is true and the card is not detected, call fs kill and destroy all handles.
    If the state changed is true and the card is detected, call fs init so that the filesystem is valid again.

    If this is done during idle, you should have the ability to swap out cards without trouble.....it's a guess anyway, from knowledge of a few versions ago.

About

Avatar for cephdon @cephdon started