[riot-notifications] [RIOT-OS/RIOT] RFC: UART enhanced settings (#10743)

MrKevinWeiss notifications at github.com
Wed Jan 23 16:52:30 CET 2019


MrKevinWeiss commented on this pull request.



> +            || (databits == UART_DATABITS_9 && parity))
+        return UART_NOMODE;
+
+    if (parity == 0x02)
+        return UART_NOMODE;
+
+    cr1 = dev(uart)->CR1;
+    cr2 = dev(uart)->CR2;
+
+    if (parity) {
+	/* enable parity */
+        cr1 |= USART_CR1_PCE;
+        /* enable 9-bit mode for 8 databits or
+           mask the MSB for 7 databits mode */
+        if (databits == UART_DATABITS_8)
+            cr1 |= USART_CR1_M; 

I think you have a handle on it, it is actually nice to use the real macro then the #if STM32F0 | STM32F1 ...

-- 
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/10743#discussion_r250253948
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190123/3ef2e1dc/attachment.html>


More information about the notifications mailing list