One of the examples in the multi.fs code contains this little gem:
: sleep ( -- ) [ $BF30 h, ] inline ; \ WFI Opcode, enters sleep mode task: lowpower-task : lowpower& ( -- ) lowpower-task activate begin eint? if \ Only enter sleep mode if interrupts have been enabled dint up-alone? if ( ." Sleep " ) sleep then eint then pause again ; It’s a task which gets called periodically, like every task in the cooperative multi-tasker, and then checks if it’s the only enabled task, i.
↧