From 0b1de0a62e65e9bcfda17ac83579dad63b2c1ffa Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Sat, 27 Feb 2021 19:25:49 -0600 Subject: [PATCH] hardware_rtc: make rtc_enable_alarm public --- src/rp2_common/hardware_rtc/include/hardware/rtc.h | 5 +++++ src/rp2_common/hardware_rtc/rtc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rp2_common/hardware_rtc/include/hardware/rtc.h b/src/rp2_common/hardware_rtc/include/hardware/rtc.h index 65028db..c054af7 100644 --- a/src/rp2_common/hardware_rtc/include/hardware/rtc.h +++ b/src/rp2_common/hardware_rtc/include/hardware/rtc.h @@ -69,6 +69,11 @@ bool rtc_running(void); */ void rtc_set_alarm(datetime_t *t, rtc_callback_t user_callback); +/*! \brief Enable the RTC alarm (if inactive) + * \ingroup hardware_rtc + */ +void rtc_enable_alarm(void); + /*! \brief Disable the RTC alarm (if active) * \ingroup hardware_rtc */ diff --git a/src/rp2_common/hardware_rtc/rtc.c b/src/rp2_common/hardware_rtc/rtc.c index 5337d33..813b5f1 100644 --- a/src/rp2_common/hardware_rtc/rtc.c +++ b/src/rp2_common/hardware_rtc/rtc.c @@ -103,7 +103,7 @@ bool rtc_get_datetime(datetime_t *t) { return true; } -static void rtc_enable_alarm(void) { +void rtc_enable_alarm(void) { // Set matching and wait for it to be enabled hw_set_bits(&rtc_hw->irq_setup_0, RTC_IRQ_SETUP_0_MATCH_ENA_BITS); while(!(rtc_hw->irq_setup_0 & RTC_IRQ_SETUP_0_MATCH_ACTIVE_BITS)) {