• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision14144 (tree)
Time2021-04-07 18:16:49
Authorcinsights

Log Message

RP basic RTC functional

Change Summary

Incremental Difference

--- trunk/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c (revision 14143)
+++ trunk/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.c (revision 14144)
@@ -73,7 +73,7 @@
7373 RTCD1.rtc = RTC;
7474
7575 /* Get clock parameters. */
76- clock = hal_lld_get_clock(clk_rtc);
76+ uint32_t clock = hal_lld_get_clock(clk_rtc);
7777 osalDbgAssert((clock > 0U) || (clock - 1 <= RTC_CLKDIV_M1_BITS), "bad clock");
7878
7979 /* Take RTC out of reset. */
@@ -80,7 +80,7 @@
8080 hal_lld_peripheral_unreset(RESETS_ALLREG_RTC);
8181
8282 /* Set divider. */
83- RTCD1.rtc.CLKDIVM1 = clock - 1;
83+ RTCD1.rtc->CLKDIVM1 = clock - 1;
8484 }
8585
8686 /**
@@ -107,7 +107,7 @@
107107 rtcp->rtc->CTRL = 0;
108108
109109 /* Wait for RTC to go inactive. */
110- while (rtccp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS != 0)
110+ while ((rtcp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS) != 0)
111111 ;
112112
113113 /* Write setup to pre-load registers. */
@@ -126,7 +126,7 @@
126126
127127 /* Enable RTC and wait for active. */
128128 rtcp->rtc->CTRL = RTC_CTRL_RTC_ENABLE_BITS;
129- while (rtccp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS == 0)
129+ while ((rtcp->rtc->CTRL & RTC_CTRL_RTC_ACTIVE_BITS) == 0)
130130 ;
131131 }
132132
--- trunk/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h (revision 14143)
+++ trunk/os/hal/ports/RP/LLD/RTCv1/hal_rtc_lld.h (revision 14144)
@@ -77,7 +77,6 @@
7777 /* Driver data structures and types. */
7878 /*===========================================================================*/
7979
80-#if (RTC_SUPPORTS_CALLBACKS == TRUE) || defined(__DOXYGEN__)
8180 /**
8281 * @brief Type of an RTC event.
8382 */
@@ -89,8 +88,8 @@
8988 * @brief Type of a generic RTC callback.
9089 */
9190 typedef void (*rtccb_t)(RTCDriver *rtcp, rtcevent_t event);
92-#endif
9391
92+
9493 /**
9594 * @brief Type of a structure representing an RTC alarm time stamp.
9695 */
Show on old repository browser