Are some timers used by WiFi or interface's (I2C, SPI, SDIO) drivers?
Code: Select all
timer_config_t config;
config.alarm_en = TIMER_ALARM_DIS;
config.counter_en = TIMER_START;
config.intr_type = TIMER_INTR_LEVEL;
config.counter_dir = TIMER_COUNT_UP;
config.auto_reload = TIMER_AUTORELOAD_DIS;
config.divider = 0xffff;
timer_init(TIMER_GROUP_0, TIMER_0, &config);
timer_start(TIMER_GROUP_0, TIMER_0);
uint64_t timer_val;
timer_get_counter_value(TIMER_GROUP_0, TIMER_0, &timer_val);
if (timer_val > 36621) { // should be 10 but is more than 31 secs
...
}