-->
Page 1 of 1

Timer not running when WLAN uninitialized

PostPosted: Thu Jun 18, 2015 4:41 am
by wpfundstein
Hi,

Code: Select allvoid ICACHE_FLASH_ATTR user_init()
{
   system_timer_reinit();

   uart_init(BIT_RATE_9600, BIT_RATE_115200);
   system_os_task(recvTask, recvTaskPrio, recvTaskQueue, recvTaskQueueLen);
   os_delay_us(1000);

   os_timer_disarm(&userTimer);
   os_timer_setfn(&userTimer, userTimerCb, NULL);
   os_timer_arm(&userTimer, 10, 1);

    wifi_set_opmode(0x00);
   
    wlan_start(); // Function to start WLAN

}


in this case the timer callback function is called. if i remark wlan_start() then the timer callback function never calls.

Any idea?

Re: Timer not running when WLAN uninitialized

PostPosted: Fri Jun 19, 2015 2:12 am
by pvvx
'Timers' and 'task' run only in cycle ets_run() (function ROM-BIOS).
Use hard timer0 (esp_iot_sdk_v1.1.2/examples/driver_lib/driver/hw_timer.c )

Re: Timer not running when WLAN uninitialized

PostPosted: Sat Jun 20, 2015 4:59 pm
by wpfundstein
Thanks, now i use hardware timer and it works.

bat i have the problem that i canĀ“t write my settings data to flash.

Werner

Re: Timer not running when WLAN uninitialized

PostPosted: Mon Jun 22, 2015 12:31 pm
by cal
Moin,

when using hardware timer you are in interrupt code I guess.
I don't know but I would expect problems running flashing code from interrupt.

What is the meaning of opmode 0?
I don't understand @pvxx argument why the cooperation aspect of SDK should hinder having software
timers.

Does someone know?

Cal