2 ms·
Most microcontrollers let you configure a timer that runs while the processor is in sleep, then triggers an interrupt to wake you up. In this style of coding y
by pjc50 11y ago
Most microcontrollers let you configure a timer that runs while the processor is in sleep, then triggers an interrupt to wake you up.
In this style of coding you end up with
main()
{
configure_interrupts();
while(1)
{
do_irq_bottom_halves();
sleep(); // "wfi" in ARM
}
}