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

Mohamed notifications at github.com
Tue Jan 22 07:39:01 CET 2019

@yegorich I found the culprit! Two issues:
- uart_stop() line 171 & 178 should be
cr1 &= ~USART_CR1_UE;   // note the ~ should be there in both cases
- stopbits seems to be not set correctly, when I change it as follow it works:

// cr2 |= stopbits;
cr2 |= USART_CR2_STOP_1;
- And of course inverting RX bin was required and you should add while you are at it.

I also recommend replacing all numeric constants with actual macro as defined in CMSIS header file. Also not use _M (mask) and use actual bit value (even if it happen to be the same) like:

if (databits == UART_DATABITS_8) {
            //cr1 |= USART_CR1_M;
            cr1 |= USART_CR1_M0;

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190121/851d4b6c/attachment.html>

More information about the notifications mailing list