コード例 #1
0
ファイル: hal_lpm.c プロジェクト: roerisi/MetaWatch-Gen2
void MSP430_LPM_ENTER(void)
{
  if ( EnterShippingModeFlag == 1)
  {
    EnterShippingMode();  
  }
  else
  {
    EnterLpm3();  
  }  
}
コード例 #2
0
ファイル: IdleTask.c プロジェクト: kimokono/MetaWatch-Gen2
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();
}