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

MrKevinWeiss notifications at github.com
Thu Jan 10 17:18:14 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; 

Should you #ifdef them around or does everything work out?

-- 
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_r246824313
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190110/e878b6aa/attachment.html>


More information about the notifications mailing list