diff options
Diffstat (limited to 'os/hal/ports/STM32/LLD')
-rw-r--r-- | os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c | 12 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c index 0b471b8f5..6ca7a00b1 100644 --- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c +++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c @@ -302,7 +302,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) { rtc_decode_date(rtcp->rtc->DR, timespec);
}
-#if (STM32_RTC_NUM_ALARMS > 0) || defined(__DOXYGEN__)
+#if (RTC_ALARMS > 0) || defined(__DOXYGEN__)
/**
* @brief Set alarm time.
*
@@ -333,7 +333,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp, rtcp->rtc->CR &= ~RTC_CR_ALRAE;
}
}
-#if STM32_RTC_NUM_ALARMS > 1
+#if RTC_ALARMS > 1
else {
if (alarmspec != NULL) {
rtcp->rtc->CR &= ~RTC_CR_ALRBE;
@@ -348,7 +348,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp, rtcp->rtc->CR &= ~RTC_CR_ALRBE;
}
}
-#endif /* STM32_RTC_NUM_ALARMS > 1 */
+#endif /* RTC_ALARMS > 1 */
}
/**
@@ -365,12 +365,12 @@ void rtc_lld_get_alarm(RTCDriver *rtcp, RTCAlarm *alarmspec) {
if (alarm == 1)
alarmspec->alrmr = rtcp->rtc->ALRMAR;
-#if STM32_RTC_NUM_ALARMS > 1
+#if RTC_ALARMS > 1
else
alarmspec->alrmr = rtcp->rtc->ALRMBR;
-#endif /* STM32_RTC_NUM_ALARMS > 1 */
+#endif /* RTC_ALARMS > 1 */
}
-#endif /* STM32_RTC_NUM_ALARMS > 0 */
+#endif /* RTC_ALARMS > 0 */
#if STM32_RTC_HAS_PERIODIC_WAKEUPS || defined(__DOXYGEN__)
diff --git a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h index d9c3958e4..2c6c5509b 100644 --- a/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h +++ b/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.h @@ -41,6 +41,11 @@ #define RTC_SUPPORTS_CALLBACKS STM32_RTC_HAS_INTERRUPTS
/**
+ * @brief Number of alarms available.
+ */
+#define RTC_ALARMS STM32_RTC_NUM_ALARMS
+
+/**
* @brief RTC PRER register initializer.
*/
#define RTC_PRER(a, s) ((((a) - 1) << 16) | ((s) - 1))
@@ -173,7 +178,7 @@ extern "C" { void rtc_lld_init(void);
void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec);
void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec);
-#if STM32_RTC_NUM_ALARMS > 0
+#if RTC_ALARMS > 0
void rtc_lld_set_alarm(RTCDriver *rtcp,
rtcalarm_t alarm,
const RTCAlarm *alarmspec);
|