cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 sleepmode problem

tonbaebae
Associate II

Hi. everyone
"I've found that when I enter sleep mode, my uwtick stops counting, which causes issues with calculating the DataCollect time after waking up with the RTC. Is there a way to resolve this?"

while(1){
    if(HAL_GetTick() >= Tcmd1_dataCollect_ts) {
        Tcmd1_dataCollect_ts = HAL_GetTick() + 10000;
        Tcmd1_DataCollect();
    }
    if(HAL_GetTick() >= Tcmd2_dataCollect_ts) {
        Tcmd2_dataCollect_ts = HAL_GetTick() + 60000;
        Tcmd2_DataCollect();
    }
    osDelay(1000);
}
"I have tried using the RTC time for calculations, but I found that it can only measure to the nearest second (I need milliseconds)."

0 REPLIES 0