Hi,
I wonder CRITICAL_REGION_EXIT() in app_sched_event_put() have to be moved to the end of function. CRITICAL_REGION_EXIT() is called after proceeding index in current app_sched_event_put(), I think this may not keep handler and data combination.
For example, there are 2 IRQ handlers, one is A IRQ handler, the other is B IRQ handler, and A's priority is higher than B's one. Each different app_sched_event_handler is pushed in scheduler using app_sched_event_put(). When A IRQ handler is called while code(line between 196 and 197 in app_scheduler.c) after CRITICAL_REGION_EXIT() in app_sched_event_put() in B IRQ handler is being executed, the combination of handler and data must be corrupted.
So I think CRITICAL_REGION_EXIT should be moved between line 212 and 213.
What do you thinke?