void vApplicationIdleHook(void) { /* Put the processor to sleep if the serial port indicates it is OK and * all of the queues are empty. * * This will stop the OS scheduler. */ #if 0 DEBUG5_HIGH(); #endif /* enter a critical section so that the flags can be checked */ __disable_interrupt(); __no_operation(); /* the watchdog is set at 16 seconds. * the battery interval rate is set a 10 seconds * each task checks in at the battery interval rate */ UpdateWatchdogInfo(); if ((WatchdogInfo.SppReadyToSleep && WatchdogInfo.TaskDelayLockCount == 0 && WatchdogInfo.DisplayMessagesWaiting == 0 && WatchdogInfo.SppMessagesWaiting == 0) || ShippingMode()) { /* Call MSP430 Utility function to enable low power mode 3. */ /* Put OS and Processor to sleep. Will need an interrupt */ /* to wake us up from here. */ MSP430_LPM_ENTER(); /* If we get here then interrupts are enabled */ // extern xTaskHandle IdleTaskHandle; // CheckStackUsage(IdleTaskHandle,"~IdlTsk "); } else { /* we aren't going to sleep so enable interrupts */ __enable_interrupt(); __no_operation(); } #if 0 DEBUG5_LOW(); #endif }
void vApplicationIdleHook(void) { /* Put the processor to sleep if the serial port indicates it is OK and * all of the queues are empty. * This will stop the OS scheduler. */ /* enter a critical section so that the flags can be checked */ __disable_interrupt(); __no_operation(); /* the watchdog is set at 16 seconds. * the battery interval rate is set a 10 seconds * each task checks in at the battery interval rate */ UpdateWatchdogInfo(); #if SUPPORT_LPM if (WatchdogInfo.SppReadyToSleep && WatchdogInfo.DisplayMessagesWaiting == 0 && WatchdogInfo.SppMessagesWaiting == 0) { /* Call MSP430 Utility function to enable low power mode 3. */ /* Put OS and Processor to sleep. Will need an interrupt */ /* to wake us up from here. */ EnterLpm3(); /* If we get here then interrupts are enabled */ return; } #endif /* we aren't going to sleep so enable interrupts */ __enable_interrupt(); __no_operation(); }
void RouteMsg(tMessage *pMsg) { SendMsgToQ(MsgInfo[pMsg->Type].MsgQueue, pMsg); UpdateWatchdogInfo(); }