Skip to content

Commit 37238b7

Browse files
committed
STM32LoRaWan set the setRTCMode before the rtc.begin to set MIX mode
The RTC.begin does not propose the RTCmode parameter. This is configured with the setRTCMode method before .begin The RTC irq (for Alarm B) is handled directly by the STM32RTC library Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent a3d885a commit 37238b7

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/BSP/rtc.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,6 @@ void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle)
140140
}
141141
}
142142

143-
void RTC_Alarm_IRQHandler(void)
144-
{
145-
/* USER CODE BEGIN RTC_Alarm_IRQn 0 */
146-
147-
/* USER CODE END RTC_Alarm_IRQn 0 */
148-
HAL_RTC_AlarmIRQHandler(&hrtc);
149-
/* USER CODE BEGIN RTC_Alarm_IRQn 1 */
150-
151-
/* USER CODE END RTC_Alarm_IRQn 1 */
152-
}
153-
154143
/* USER CODE BEGIN 1 */
155144

156145
/* USER CODE END 1 */

src/STM32LoRaWAN.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ bool STM32LoRaWAN::begin(_lora_band band)
7171
* the sub-second counter RTC_SSR on 32 bit
7272
*/
7373
rtc.setClockSource(STM32RTC::LSE_CLOCK);
74-
rtc.begin(true, STM32RTC::HOUR_24, STM32RTC::MODE_MIX);
74+
rtc.setRTCMode(STM32RTC::MODE_MIX);
75+
rtc.begin(true, STM32RTC::HOUR_24);
7576
/* Attach the callback function before enabling Interrupt */
7677
rtc.attachInterrupt(UTIL_TIMER_IRQ_MAP_PROCESS, STM32RTC::ALARM_B);
7778
/* The subsecond alarm B is set during the StartTimerEvent */

0 commit comments

Comments
 (0)