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

How stop nrf_cal_set_callback(calendar_updated, test_Interval); fun.

Hello,

We are using nRF52840 with SES sdk 15.0 version. My other thread is here in that got problem with nrf_cal_set_callback(calendar_updated, test_Interval); this function callback as per interval but i want stop this callback how i can do this. Will you please tell me in details how work this nrf_cal_set_callback function.

One another issue is in uart_event_handler() if i call sleep_mode_enter(); in uart_event_handler is any problem because when sleep mode enter program is not work and also not show any error. uart_event_handler is callback function how i know all callback is done so then i will call sleep mode enter function.

Thanks in advanced...

  • Hi Vishal

    There is no function to stop the callback, but one can easily be implemented. All you have to do is set the callback pointer to 0:

    void nrf_cal_clear_callback(void)
    {
        cal_event_callback = 0;
    }

    Are you calling the sleep_mode_enter() function inside the callback?

    This is not recommended. Instead you should call this function inside the infinite loop in main(), so that it is repeatedly called when you don't have any other processing to do. 

    Pretty much all the SDK examples work this way. 

    Best regards
    Torbjørn

  • Thanks for your suggestion...!!!

    As you suggested this working fine and we are also use to stop callback like this:-->

    nrf_cal_set_callback(NULL, 0); /* Stop cron scheduler call back*/

    Thanks..!!!

Related