You are surely right, Alex.
I'm observing the asm, and I think I got the problem, but not yet the reason:
void appPrepareSleep(void)
{
zdoSleepReq.ZDO_SleepConf = appZdoSleepConf;
3a: 80 e0 ldi r24, 0x00 ; 0
3c: 90 e0 ldi r25, 0x00 ; 0
3e: 90 93 00 00 sts 0x0000, r25
42: 80 93 00 00 sts 0x0000, r24
ZDO_SleepReq(&zdoSleepReq);
46: 80 e0 ldi r24, 0x00 ; 0
48: 90 e0 ldi r25, 0x00 ; 0
4a: 0e 94 00 00 call 0 ; 0x0 <APL_TaskHandler>
4e: 00 c0 rjmp .+0 ; 0x50 <APL_TaskHandler+0x50>
What is your opinion last but one line? Calling 0 looks a bad idea, no?
I also have this one for the appSleep() function. In this, appPostGlobalTask calls also 0, which is somewhat strange for me too.
void appSleep(void)
{
appState = APP_PREPARE_SLEEP;
0: 85 e0 ldi r24, 0x05 ; 5
2: 80 93 00 00 sts 0x0000, r24
appPostGlobalTask();
6: 0e 94 00 00 call 0 ; 0x0 <appSleep>
a: 08 95 ret
Seems that calling 0 is present in many times in the assembly, around the sleeping functions. Don't know if this is something wierd, or just normal.