diff --git a/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c b/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c index c8d0885d4..25bfc88ad 100644 --- a/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c +++ b/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c @@ -73,14 +73,14 @@ void rtc_lld_init(void) { RTCD1.rtc = RTC; /* Get clock parameters. */ - clock = hal_lld_get_clock(clk_rtc); + uint32_t clock = hal_lld_get_clock(clk_rtc); osalDbgAssert((clock > 0U) || (clock - 1 <= RTC_CLKDIV_M1_BITS), "bad clock"); /* Take RTC out of reset. */ hal_lld_peripheral_unreset(RESETS_ALLREG_RTC); /* Set divider. */ - RTCD1.rtc.CLKDIVM1 = clock - 1; + RTCD1.rtc->CLKDIVM1 = clock - 1; } /** @@ -107,7 +107,7 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) { rtcp->rtc->CTRL = 0; /* Wait for RTC to go inactive. */ - while (rtccp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS != 0) + while ((rtcp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS) != 0) ; /* Write setup to pre-load registers. */ @@ -126,7 +126,7 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) { /* Enable RTC and wait for active. */ rtcp->rtc->CTRL = RTC_CTRL_RTC_ENABLE_BITS; - while (rtccp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS == 0) + while ((rtcp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS) == 0) ; } diff --git a/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h b/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h index 73104b8de..b7a496af5 100644 --- a/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h +++ b/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h @@ -77,7 +77,6 @@ /* Driver data structures and types. */ /*===========================================================================*/ -#if (RTC_SUPPORTS_CALLBACKS == TRUE) || defined(__DOXYGEN__) /** * @brief Type of an RTC event. */ @@ -89,7 +88,7 @@ typedef enum { * @brief Type of a generic RTC callback. */ typedef void (*rtccb_t)(RTCDriver *rtcp, rtcevent_t event); -#endif + /** * @brief Type of a structure representing an RTC alarm time stamp. diff --git a/os/hal/ports/RP/RP2040/platform.mk b/os/hal/ports/RP/RP2040/platform.mk index 041210123..f5000556d 100644 --- a/os/hal/ports/RP/RP2040/platform.mk +++ b/os/hal/ports/RP/RP2040/platform.mk @@ -28,6 +28,7 @@ endif include $(CHIBIOS)/os/hal/ports/RP/LLD/GPIOv1/driver.mk include $(CHIBIOS)/os/hal/ports/RP/LLD/TIMERv1/driver.mk include $(CHIBIOS)/os/hal/ports/RP/LLD/UARTv1/driver.mk +include $(CHIBIOS)/os/hal/ports/RP/LLD/RTCv1/driver.mk # Shared variables ALLCSRC += $(PLATFORMSRC)