You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Starting a timer with huge time make the timer trigger without waiting.
Ex: k_timer_start(&timer, K_HOURS(19), 0); does not work at all whereas k_timer_start(&timer, K_HOURS(18), 0); is working. The problem seems to come from conversion from duration to tick witch is limited to signed 32 bits. as soon as the conversion in tick is greater than 0x7FFFFFFF, the timer is not working at all.
To Reproduce
#include<zephyr.h>#include<kernel.h>staticvoidhandler(structk_timer*dummy)
{
printk("handler called\n");
}
K_TIMER_DEFINE(timer, handler, NULL);
voidmain(void)
{
printk("test Timer !\n");
#ifdefNOT_WORKINGk_timer_start(&timer, K_HOURS(19), 0); // handler is called immediately#elsek_timer_start(&timer, K_HOURS(18), 0); // handler is called after 18 hours#endif
}
Steps to reproduce the behavior:
mkdir build; cd build
cmake -DBOARD=nrf52_pca10040 path_to_above_main
make
Expected behavior
timer to trigger after 19 hours
Impact
showstopper
Environment (please complete the following information):
Describe the bug
Starting a timer with huge time make the timer trigger without waiting.
Ex: k_timer_start(&timer, K_HOURS(19), 0); does not work at all whereas k_timer_start(&timer, K_HOURS(18), 0); is working. The problem seems to come from conversion from duration to tick witch is limited to signed 32 bits. as soon as the conversion in tick is greater than 0x7FFFFFFF, the timer is not working at all.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
timer to trigger after 19 hours
Impact
showstopper
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: