Solved
wake from WFI and *immediately* execute my code ??
__WFI works beauty. But I want more. Behold:
void vApplicationIdleHook() {
__WFI();
my_own_code(); // on wake, this will be executed *after* the intr handler :(
}Upon every wake from WFI, I want to execute my own code immediately: ie. before any intr handler, and before any other threads.
I could slap "my_own_code();" into the top of *every* interrupt handler... but that is too much work.
Anyone have any ideas?