File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
libraries/SrcWrapper/src/stm32 Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ static uint8_t HSEDiv = 0;
6666/* Custom user values */
6767static int8_t userPredivAsync = -1 ;
6868static int16_t userPredivSync = -1 ;
69+ static uint32_t userCalib = 0 ;
6970
7071static hourFormat_t initFormat = HOUR_FORMAT_12 ;
7172
@@ -316,7 +317,8 @@ void RTC_setCalib(uint32_t minusPulsesValue) // sakinit
316317#elif defined(STM32F1xx )
317318 const uint32_t Calib_Mask = 0x7FU ;
318319#endif
319- HAL_RTCEx_SetSmoothCalib (& RtcHandle , 0 , 0 , minusPulsesValue & Calib_Mask );
320+ userCalib = minusPulsesValue & Calib_Mask ;
321+ HAL_RTCEx_SetSmoothCalib (& RtcHandle , 0 , 0 , userCalib );
320322}
321323
322324/**
@@ -336,7 +338,11 @@ uint32_t RTC_getDefaultClockFrequency() //sakinit
336338 */
337339uint32_t RTC_getCalib () // sakinit
338340{
341+ #if defined(STM32F1xx )
339342 return LL_RTC_CAL_GetCoarseDigital (BKP );
343+ #else
344+ return userCalib ;
345+ #endif
340346}
341347
342348/**
You can’t perform that action at this time.
0 commit comments