-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Milestone
Description
Hello,
I am experiencing a problem with repeating timer in SDK 2.1.0 (I haven't seen it in SDK 1.x.x before). The problem seems happen only when timer callback function is "light" (I mean doesn't contain too much of processing):
repeating_timer_t my_sampling_timer;
bool my_timer_callback(repeating_timer_t *rt)
{
//volatile int tmp = 0;
//for(int i=0; i <10000; i++)
//{
// tmp++;
//}
return true;
}
int main()
{
alarm_pool_t *pool = alarm_pool_create(2, 1);
alarm_pool_add_repeating_timer_ms(pool, -20, my_timer_callback, NULL, &my_sampling_timer);
while(1)
{
printf("looping\n");
}
}
If the code is as above, the callback is called only few times. If I uncomment commented part in the callback (to make functionality to spend some more time in callback), the callback is called still during main looping (as desired).
The problem happens in the RELEASE build only.
I use GCC 10.3.1 (not sure if related, probably not)
dpgeorge
Metadata
Metadata
Assignees
Labels
No labels