Hi David,
If you take a look the JN-AN-1229, the app_sleeping_enddevice.c file, you will find:
PUBLIC void vAppMain(void)
{
.
.
.
.
.
.
.
APP_vInitResources();
APP_vSetUpHardware();
vInitialiseApp();
app_vMainloop();
}
So, as you can see, inside this funtion, we have the vInitialiseApp(); and after that configuration you will call the app_vMainLoop and stay forever in this function while(1);
PRIVATE void vInitialiseApp(void)
{
PWRM_vInit(E_AHI_SLEEP_OSCON_RAMON);
#ifdef PDM_EEPROM
PDM_eInitialise(63);
PDM_vRegisterSystemCallback(vPdmEventHandlerCallback);
#else
PDM_vInit(7, 1, 64 * 1024 , NULL, NULL, NULL, &g_sKey);
#endif
PDUM_vInit();
ZPS_vExtendedStatusSetCallback(vfExtendedStatusCallBack);
APP_vInitialiseSleepingEndDevice();
}
You can set the sleep mode that you want, PWRM_vInit(E_AHI_SLEEP_DEEP);
Note: Remember that you have to define the next functions, also you can take as reference the example:
-PWRM_vRegisterPreSleepCallback
-PWRM_vRegisterWakeupCallback
PWRM_eScheduleActivity(&sWake, SLEEP_TIME, vWakeCallBack);
For a better reference 7. PWRM API
http://www.nxp.com/docs/en/user-guide/JN-UG-3116.pdf?fsrch=1&sr=1&pageNum=1
The Deep Sleep Mode is waiting on chip RESET or I/O event.
Hope it helps. I am working in an example for the different sleep modes, but It will take some time.
Best Regards
Mario