I'd like to implement some form of producer ISR, consumer thread queue and found the following page:
http://www.chibios.org/dokuwiki/doku.ph ... el_mutexes
I'm trying to make sense of the "Producer from ISRs" example.
I was hoping someone would be able to help explain the behaviour of qConsume():
- chSysLock() disables interrupts
- The mutex is locked
- The queue is empty
- chCondWaitS() is used to:
- free the mutex
- wait on the queue to fill
Will the chSysLock() call still be active and blocking interrupts during this wait?
I think my understanding of the "S" system state is lacking - it's possible to sleep in an S state?
Some relevant documentation:
chCondWaitS - http://chibios.sourceforge.net/docs3/rt ... 2ab2c2996c
System States - http://chibios.sourceforge.net/html/con ... tem_states
chSchGoSleepS - http://chibios.sourceforge.net/html/gro ... 19c1ccf986