[riot-notifications] [RIOT-OS/RIOT] cpu/atmega_common/periph/pwm: Minor fix & cleanup (#12827)

Marian Buschsieweke notifications at github.com
Sat May 16 11:07:10 CEST 2020


@maribu commented on this pull request.



> +    state[dev].CRA = cra;
+    state[dev].CRB = crb;
+}
+
+static inline void apply_config(pwm_t dev)
+{
+    pwm_conf[dev].dev->CRA = state[dev].CRA;
+    pwm_conf[dev].dev->CRB = state[dev].CRB;
+
+    if (pwm_conf[dev].pin_ch[0] == GPIO_UNDEF) {
+        /* If channel 0 is not used, variable resolutions can be used for
+         * channel 1 */
+        pwm_conf[dev].dev->OCR[0] = state[dev].res;
+    }
+}
+
 uint32_t pwm_init(pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res)

Fixed

-- 
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/12827#discussion_r426135442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200516/67f8fe3e/attachment-0001.htm>


More information about the notifications mailing list