try standby mode
This commit is contained in:
parent
25da5701d2
commit
0b430cba4e
|
@ -78,14 +78,30 @@ const struct UTIL_LPM_Driver_s UTIL_PowerDriver =
|
||||||
void PWR_EnterOffMode(void)
|
void PWR_EnterOffMode(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN EnterOffMode_1 */
|
/* USER CODE BEGIN EnterOffMode_1 */
|
||||||
|
/* Enable Power Clock */
|
||||||
|
HAL_SuspendTick();
|
||||||
|
|
||||||
|
/* Disable all used wakeup sources: Pin1(PA.0) */
|
||||||
|
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1|PWR_WAKEUP_PIN2|PWR_WAKEUP_PIN3);
|
||||||
|
|
||||||
|
/* Clear all related wakeup flags */
|
||||||
|
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
|
||||||
|
|
||||||
|
/* Re-enable all used wakeup sources: Pin1(PA.0) */
|
||||||
|
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
|
||||||
|
|
||||||
|
/*## Enter Standby Mode ####################################################*/
|
||||||
|
/* Request to enter STANDBY mode */
|
||||||
|
HAL_PWR_EnterSTANDBYMode();
|
||||||
/* USER CODE END EnterOffMode_1 */
|
/* USER CODE END EnterOffMode_1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
void PWR_ExitOffMode(void)
|
void PWR_ExitOffMode(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN ExitOffMode_1 */
|
/* USER CODE BEGIN ExitOffMode_1 */
|
||||||
|
//HAL_ResumeTick();
|
||||||
|
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
|
||||||
|
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
|
||||||
/* USER CODE END ExitOffMode_1 */
|
/* USER CODE END ExitOffMode_1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue