Dartmouth-Formula-Racing / DFR_CVC_2019

Dartmouth Formula Racing Central Vehicle Controller Codebase
10 stars 5 forks source link

FatFs critical sections #20

Open leina05 opened 5 years ago

leina05 commented 5 years ago

Best practice would be to add critical sections around fopen, fwrite sections: http://elm-chan.org/fsw/ff/doc/appnote.html

This doesn't work at the moment because we are calling disk_initialize from fopen the first time (because we are using delayed mount in f_mount), which creates the SD_Queue using xQueueCreate which requires interrupts to be enabled. Could fix this by mounting immediately in f_mount, but then would have to create the Queue somewhere else because it requires the kernel to be running sigh

Not a super high priority right now but something to keep in mind.