コード例 #1
0
ファイル: rtc-board.c プロジェクト: Lora-net/LoRaMac-node
void RtcEnterLowPowerStopMode( void )
{
    if( ( LowPowerDisableDuringTask == false ) && ( RtcTimerEventAllowsLowPower == true ) )
    {
        BoardDeInitMcu( );

        // Disable the Power Voltage Detector
        HAL_PWR_DisablePVD( );

        SET_BIT( PWR->CR, PWR_CR_CWUF );

        // Enable Ultra low power mode
        HAL_PWREx_EnableUltraLowPower( );

        // Enable the fast wake up from Ultra low power mode
        HAL_PWREx_EnableFastWakeUp( );

        // Enter Stop Mode
        HAL_PWR_EnterSTOPMode( PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI );
    }
}
コード例 #2
0
ファイル: rtc-board.c プロジェクト: davincicloud-kr/im-l200
void RtcEnterLowPowerStopMode( void )
{
    if( ( LowPowerDisableDuringTask == false ) && ( RtcTimerEventAllowsLowPower == true ) )
    {
        // Disable IRQ while the MCU is being deinitialized to prevent race issues
        __disable_irq( );

        BoardDeInitMcu( );

        __enable_irq( );

        /* Disable the Power Voltage Detector */
        PWR_PVDCmd( DISABLE );

        /* Set MCU in ULP (Ultra Low Power) */
        PWR_UltraLowPowerCmd( ENABLE );

        /*Disable fast wakeUp*/
        PWR_FastWakeUpCmd( DISABLE );

        /* Enter Stop Mode */
        PWR_EnterSTOPMode( PWR_Regulator_LowPower, PWR_STOPEntry_WFI );
    }
}