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)
372
372
/* USER CODE END TIMER_IF_DelayMs_Last */
373
373
}
374
374
375
- void HAL_RTCEx_SSRUEventCallback ( RTC_HandleTypeDef * hrtc )
375
+ WEAK void TIMER_IF_SSRUCallback ( void * data )
376
376
{
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 */
382
379
TIMER_IF_DBG_PRINTF (">>Handler SSRUnderflow at %d\n\r" , GetTimerTicks ());
383
- /*Increment MSBticks*/
380
+ /* Increment MSBticks */
384
381
uint32_t MSB_ticks = TIMER_IF_BkUp_Read_MSBticks ();
385
382
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 */
389
383
}
390
384
391
385
uint32_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);
130
130
*/
131
131
uint32_t TIMER_IF_Convert_Tick2ms (uint32_t tick );
132
132
133
+ /**
134
+ * @brief rtc SSRU Event Callback
135
+ * @param[in] data not used
136
+ */
137
+ void TIMER_IF_SSRUCallback (void * data );
138
+
133
139
/**
134
140
* @brief Get rtc time
135
141
* @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)
75
75
_rtc.begin (true , STM32RTC::HOUR_24);
76
76
/* Attach the callback function before enabling Interrupt */
77
77
_rtc.attachInterrupt (UTIL_TIMER_IRQ_MAP_PROCESS, STM32RTC::ALARM_B);
78
+ _rtc.attachSecondsInterrupt (TIMER_IF_SSRUCallback);
78
79
/* The subsecond alarm B is set during the StartTimerEvent */
79
80
80
81
UTIL_TIMER_Init (_rtc.getHandle ());
You can’t perform that action at this time.
0 commit comments