Hello Devs,
I am using app_timer to create multiple timers to read different sensors
Currently, I have 5 timers created using app_timer_create, each timer has their own callback, inside each callback I call app_sched_event_put() to run the specific function for each sensor in the main context, in theory, it should be working fine, but some times after initialize my code it gets stucks, I noticed it happens when two or more timers have the same interval (e.g trigger every 3 seconds)
I have more callbacks as the code below fo each sensor, actually, they have the same code the only difference is the value for "type"r:
void timerCallbackForTemperature(void *p_context) { uint8_t type = 1; //temperature app_sched_event_put(&type, sizeof(type), Event); }
The app_sched_event_put always returns nrf_success / 0, but some times it does not fire the callback for the scheduler callback and it is when my code hangs.
I believe two timers callback are happening at the same time and it hangs my code, or idk if it is something pure related to the scheduler
note:
SDK13 and nRF52
issue related: https://devzone.nordicsemi.com/f/nordic-q-a/11412/calling-app_sched_event_put-inside-interrupt