Open GanesanGuru opened 9 months ago
Hi @GanesanGuru,
The timer should return the milliseconds. Sometimes the host system timers have a different resolution, for example 10ms, or even 1µs. A conversion to milliseconds is necessary then.
Here's an example for the ESP-IDF which configures the default tick rate of FreeRTOS to be 100 ticks per second:
To make something similar, pass your own mocpp_tick_ms_espidf
conversion function to mocpp_set_timer
.
Note that MO expects that the timer uses the full 2^32 bit value range of unsigned long
. It should take the timer ~49.7 days to reach the maximum value and afterwards it should roll over to 0. The ESP-IDF platform integration achieves that by using a separate counter for example.
Hi @matth-x , I've follow the steps and when I tried to connect the MO_CUSTOM_TIMER to iMX RT1064 EVK, the mongoose connection/MO_CUSTOM_WS is being resetting continuously.
LWIP Network stack that is running in iMX RT1064. Hence, I've passed the sys_now to mocpp_set_timer - callback function as
mocpp_set_timer(sys_now);
If I'm not passing that parameter, the code executes - but for later stages of developemnt - as timer configuration is mandatory, aid me to fix this