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

how to Restart advertising after timeout?

Hi. For my application, i want to do a battery saver profile. I need to send one advertising package every 30second. So now i do this by setting

#define ADV_TIMEOUT_IN_SECONDS          5
#define ADV_INTERVAL_IN_MS              10000     

and by setting a WDT that reset system every 29 second

void wdt_init(void)
{
NRF_WDT->CONFIG = (WDT_CONFIG_HALT_Pause << WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run << WDT_CONFIG_SLEEP_Pos);
NRF_WDT->CRV = 29*32768; 
NRF_WDT->RREN |= WDT_RREN_RR0_Msk;  
NRF_WDT->TASKS_START = 1;

I think there is a better way to do this. can you help me? thanks so much

Related