[riot-notifications] [RIOT-OS/RIOT] Update cpu/stm32/periph/rtc_all.c for CPU_FAM_STM32L5 support. (#16656)

Francisco notifications at github.com
Mon Jul 19 09:15:10 CEST 2021


@fjmolinas commented on this pull request.

Looks good, only a minor styling comment and request for more comments :)

> +    EXTI_REG_IMR  |= EXTI_IMR_BIT;
+#if !defined(CPU_FAM_STM32L5)
     EXTI_REG_FTSR &= ~(EXTI_FTSR_BIT);
     EXTI_REG_RTSR |= EXTI_RTSR_BIT;
-    EXTI_REG_IMR  |= EXTI_IMR_BIT;
     EXTI_REG_PR   = EXTI_PR_BIT;
+#endif

I'm assuming the order does not matter here?

> +    if (RTC_REG_SR & RTC_SR_ALRAF) {
+        if (isr_ctx.cb != NULL) {
+        isr_ctx.cb(isr_ctx.arg);
+        }
+        stmclk_dbp_unlock();
+        RTC_REG_SCR = RTC_SCR_CALRAF;
+        stmclk_dbp_lock();
+    }
+#endif

You mention this is not specified in the datasheet or errata, how did you come up to this fix? Do you mind adding a comment mentioning the reasoning?

>      if (RTC_REG_ISR & RTC_ISR_ALRAF) {
         if (isr_ctx.cb != NULL) {
             isr_ctx.cb(isr_ctx.arg);
         }
         RTC_REG_ISR &= ~RTC_ISR_ALRAF;
     }
     EXTI_REG_PR = EXTI_PR_BIT; /* only clear the associated bit */
+#else
+    if (RTC_REG_SR & RTC_SR_ALRAF) {
+        if (isr_ctx.cb != NULL) {
+        isr_ctx.cb(isr_ctx.arg);

```suggestion
            isr_ctx.cb(isr_ctx.arg);
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16656#pullrequestreview-709218677
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210719/bfbf4592/attachment.htm>


More information about the notifications mailing list