Hello,
This behavior within the SDK has bitten me a couple times so I thought it would be a good thing to share. If you call app_sched_event_put(NULL, 0, &my_function), when "my_function" is called, the data pointer is not NULL for the size parameter is zero. Therefore the following will not work.
Caller:
extern void event_handler(void* data, size_t data_len); app_sched_event_put(NULL, 0, event_handler);
Callee:
void event_handler(void* data, size_t data_len)
{
// This will not work, check data+len instead
if (data == NULL) {
do_something();
}
}