This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

about schedular

After reading a few related questions and the official tutorial, I have a guess, hoping to confirm:

If I do not need to add extra events into schedular for management purposes, only the default event (such as ble_evt_handler's event in main.c) is required. Can I set EVENT_SIZE in APP_SCHED_INIT to 0 because I looked at the SD handler's code and No put event into schedular, put only a function pointer

void SD_EVT_IRQHandler (void)
{
     ret_code_t ret_code = app_sched_event_put (NULL, 0, appsh_events_poll);
     APP_ERROR_CHECK (ret_code);
}
Parents
  • Yes, that is correct. EVENT_SIZE is the maximum size of event data to be passed through the scheduler. So if you never schedule events with event data, setting EVENT_SIZE to 0 is fine.

    I guess the documentation would have been a little clearer if it had said

     [in]	EVENT_SIZE	Maximum size of **event data** to be passed through the scheduler.
    

    instead of

    [in]	EVENT_SIZE	Maximum size of events to be passed through the scheduler.
    
Reply
  • Yes, that is correct. EVENT_SIZE is the maximum size of event data to be passed through the scheduler. So if you never schedule events with event data, setting EVENT_SIZE to 0 is fine.

    I guess the documentation would have been a little clearer if it had said

     [in]	EVENT_SIZE	Maximum size of **event data** to be passed through the scheduler.
    

    instead of

    [in]	EVENT_SIZE	Maximum size of events to be passed through the scheduler.
    
Children
Related