We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Greetings.
We want to sleep if there is nothing to do. Most of the work is handled by a task queue that may be revised by an interrupt handler. The race we'd like to avoid is
1) Disable IRQs 2) Task queue is empty, so we decide to sleep 3) Enable IRQs 4) Interrupt taken an a new task is added to the queue. 5) WFI (because we think that we have nothing more to do.)
On the MSP403, the IRQ enable and sleep can be done with a single register write. Is there something in the Coretex-m3 that functions the same way? Are we supposed to use another mechanism?
Cheers.
I'm finding that the SEV/WFE mechanism is adequate to solve the problem of a race between draining a work queue and interrupts that may add to the queue. It may tend to awaken the CPU too often, but that is a small cost considering the ease of implementation and reliability of the SEV/WFE mechanism.