[riot-notifications] [RIOT-OS/RIOT] cpu/stm32: cleanup timer structure in vendor headers (#14144)

Francisco notifications at github.com
Tue May 26 17:48:45 CEST 2020


@fjmolinas commented on this pull request.



> @@ -53,7 +53,7 @@ uint32_t pwm_init(pwm_t pwm, pwm_mode_t mode, uint32_t freq, uint16_t res)
     dev(pwm)->CR1 = 0;
     dev(pwm)->CR2 = 0;
     for (unsigned i = 0; i < TIMER_CHAN; ++i) {
-        dev(pwm)->CCR[i] = 0;
+        *(__IO uint32_t *)(&dev(pwm)->CCR1 + i) = 0;

I'm not sure if the case to volatile is needed here, you are declaring the pointer as volatile, when I think only the content should be volatile, the address (pointer) will not change. (same for other occurences)
```suggestion
        *(&dev(pwm)->CCR1 + i) = 0;
```

-- 
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/14144#pullrequestreview-418436323
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200526/085a430b/attachment.htm>


More information about the notifications mailing list