We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e851941 commit 053072cCopy full SHA for 053072c
targets/TARGET_STM/sleep.c
@@ -53,6 +53,7 @@ void hal_deepsleep(void)
53
{
54
// Stop HAL tick
55
HAL_SuspendTick();
56
+ uint32_t EnterTimeUS = us_ticker_read();
57
58
// Request to enter STOP mode with regulator in low power mode
59
#if TARGET_STM32L4
@@ -84,6 +85,10 @@ void hal_deepsleep(void)
84
85
// After wake-up from STOP reconfigure the PLL
86
SetSysClock();
87
88
+ TIM_HandleTypeDef TimMasterHandle;
89
+ TimMasterHandle.Instance = TIM_MST;
90
+ __HAL_TIM_SET_COUNTER(&TimMasterHandle, EnterTimeUS);
91
+
92
#if DEVICE_LOWPOWERTIMER
93
rtc_synchronize();
94
#endif
0 commit comments