File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -372,20 +372,14 @@ void TIMER_IF_DelayMs(uint32_t delay)
372372 /* USER CODE END TIMER_IF_DelayMs_Last */
373373}
374374
375- void HAL_RTCEx_SSRUEventCallback ( RTC_HandleTypeDef * hrtc )
375+ WEAK void TIMER_IF_SSRUCallback ( void * data )
376376{
377- (void )hrtc ; // unused
378- /* USER CODE BEGIN HAL_RTCEx_SSRUEventCallback */
379-
380- /* USER CODE END HAL_RTCEx_SSRUEventCallback */
381- /*called every 48 days with 1024 ticks per seconds*/
377+ (void )data ;
378+ /* called every 48 days with 1024 ticks per seconds */
382379 TIMER_IF_DBG_PRINTF (">>Handler SSRUnderflow at %d\n\r" , GetTimerTicks ());
383- /*Increment MSBticks*/
380+ /* Increment MSBticks */
384381 uint32_t MSB_ticks = TIMER_IF_BkUp_Read_MSBticks ();
385382 TIMER_IF_BkUp_Write_MSBticks (MSB_ticks + 1 );
386- /* USER CODE BEGIN HAL_RTCEx_SSRUEventCallback_Last */
387-
388- /* USER CODE END HAL_RTCEx_SSRUEventCallback_Last */
389383}
390384
391385uint32_t TIMER_IF_GetTime (uint32_t * mSeconds )
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ uint32_t TIMER_IF_Convert_ms2Tick(uint32_t timeMilliSec);
130130 */
131131uint32_t TIMER_IF_Convert_Tick2ms (uint32_t tick );
132132
133+ /**
134+ * @brief rtc SSRU Event Callback
135+ * @param[in] data not used
136+ */
137+ void TIMER_IF_SSRUCallback (void * data );
138+
133139/**
134140 * @brief Get rtc time
135141 * @param[out] subSeconds in ticks
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ bool STM32LoRaWAN::begin(_lora_band band)
7575 _rtc.begin (true , STM32RTC::HOUR_24);
7676 /* Attach the callback function before enabling Interrupt */
7777 _rtc.attachInterrupt (UTIL_TIMER_IRQ_MAP_PROCESS, STM32RTC::ALARM_B);
78+ _rtc.attachSecondsInterrupt (TIMER_IF_SSRUCallback);
7879 /* The subsecond alarm B is set during the StartTimerEvent */
7980
8081 UTIL_TIMER_Init (_rtc.getHandle ());
You can’t perform that action at this time.
0 commit comments