FatFS Insert/Remove events

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

FatFS Insert/Remove events

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: FatFS Insert/Remove events

Post by Giovanni »

The registration must be done in the context of the thread handling the events.

Giovanni
Post Reply