Hello all! I'm in need of some suggestions for reducing the current consumption of an STM32F411 target. For reasons I won't get into here, I've rolled my own event processor that handles all peripheral interactions. Timer events are pushed onto an event queue by a timer ISR every 10ms. My question is, what is the optimal method of sleeping the processor in between event handles? Ideally, I'd like to implement something like this:
// global object instantiations
int main(void)
{
// initialize peripherals
while(true)
{
event_processor.handle();
__WFI();
}
}
In my testing, typically only 0.3% of the CPU time is spent inside handle(), so my setup has plenty of processing bandwidth. Adding WFI() has only reduced current consumption by a few mA, nothing close to the figures listed in the datasheet. What would be the best way to accomplish this, while guaranteeing that handle() is called every 10ms?