-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers/periph: Remove UART from device_enums.h #14916
Conversation
...this has been an effective form of procrastination. |
3cd1248
to
62d1ebb
Compare
sorry for not running static checks... Should be better now, but we will see. |
62d1ebb
to
76a90f7
Compare
I can wait until this doc_check issue is solved as it seems to be more a CI problem. |
ded9a06
to
e7878ec
Compare
Looks like CI is happy, just waiting for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor style improvements, otherwise that looks OK.
cpu/lm4f120/periph/uart.c
Outdated
/* Check to make sure the UART peripheral is present */ | ||
if(!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)){ | ||
if (!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)){ | |
if (!ROM_SysCtlPeripheralPresent(SYSCTL_PERIPH_UART0)) { |
cpu/lm4f120/periph/uart.c
Outdated
return UART_NODEV; | ||
} | ||
|
||
int res = init_base(uart, baudrate); | ||
if(res != UART_OK){ | ||
if (res != UART_OK){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (res != UART_OK){ | |
if (res != UART_OK) { |
cpu/lm4f120/periph/uart.c
Outdated
if (ulStatus & (UART_INT_RX | UART_INT_RT)) | ||
{ | ||
while(ROM_UARTCharsAvail(UART0_BASE)) | ||
while (ROM_UARTCharsAvail(UART0_BASE)) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ulStatus & (UART_INT_RX | UART_INT_RT)) | |
{ | |
while(ROM_UARTCharsAvail(UART0_BASE)) | |
while (ROM_UARTCharsAvail(UART0_BASE)) | |
{ | |
if (ulStatus & (UART_INT_RX | UART_INT_RT)) { | |
while (ROM_UARTCharsAvail(UART0_BASE)) { |
(doesn't render well sorry)
Thanks, will get to it tomorrow morning! |
Change uart dev 1 to use UART2 on p9 and p10 since p0 and p1 are not accessable
e7878ec
to
bdeb395
Compare
rebased and squash with the fixes (hope that is OK). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust your testing on mbed_lpc1768
which has the more in-depth changes, other CPU changes are straight forward.
ACK
Thanks for the review @aabadie ! |
hmmm something happened with the |
That was annoying, OK should be fix -> #14990 |
Contribution description
In order to remove the need for the legacy device_enums and clean things up all boards using UART definitions from device_enums have been updated.
This includes:
ek-lm4f120xl
- Since only UART0 was implemented, asserts ensure only that uart is implemented.mbed_lpc1768
- Implementation for all uarts are added assuming pins are together, periph conf was updated for uart 1 to be on p9 and p10 since they were previously inaccessablemsb-430
- Implementation does not require device_enums.hmsb-430h
- Implementation does not require device_enums.hnrf6310
- Implementation does not require device_enums.hseeeduino_arch-pro
- Implementation for all uarts are added assuming pins are togethertelosb
- Implementation does not require device_enums.hz1
- Implementation does not require device_enums.hSome generic cleanup also applied to files as new static checks have shown warnings.
Testing procedure
Use
tests/periph_uart
to ensure communication (stdio uart) and any additional uarts.The
lpc1768
cpu change was verified with thembed_lpc1768
by enabling uart 1 and reading loopback messages.Issues/PRs references
Step forward with #7941