My code looks as follows:
volatile int tmr_done;
static os_timer_t tmr;
void tmrfc(void *arg) {
ETS_GPIO_INTR_DISABLE();
tmr_done = 1;
//*((int *)arg) = 1;
printf("tmr triggered!\n\r");
ETS_GPIO_INTR_ENABLE();
}
float test() {
tmr_done = 0;
printf("waiting for tm...\n\r");
os_timer_disarm(&tmr);
os_timer_setfn(&tmr, (os_timer_func_t *)tmrfc, ready);
os_timer_arm(&tmr, 1000, 0); // ms
while(tmr_done != 1) {
system_soft_wdt_feed();
os_delay_us(10000); // avoid watchdog
}
printf("tmr was delivered!\n\r");
}