Page 1 of 1

FatFS Insert/Remove events

Posted: Sun Mar 09, 2014 11:22 am
by Tabulous
Ive got all the SD-Card running nicely, but it was based on an example where all the code is in main.c

So to make it more readable/modular i wanted to move all the SD-Card Insert/Remove code into its own file, but it doing so it does not work anymore.

The events are not triggered for Insert or Removal. The examples chEvtDispatch is called from c main loop, im my new version i create a thread to look after this, but it does not fire the events.

Now looking into this more, it seems that any call to chEvtRegister to register events as to be in the same thread context, does this sound correct. i.e. all events have to be registered in the same thread context as that calls the event dispatcher?

Re: FatFS Insert/Remove events

Posted: Sun Mar 09, 2014 12:57 pm
by Giovanni
The registration must be done in the context of the thread handling the events.

Giovanni