cpu/fe310: slightly rework the uart driver#12917
Conversation
9e942cc to
07a1d34
Compare
|
Force pushing causes github notification links to go stale. :( |
Sorry, some racy workflow: since I got no review yet and noticed failures on Murdock, I thought it was ok. |
07a1d34 to
7aa7cec
Compare
|
@aabadie you have pushed a lot to this one, is this WIP or ready for review? |
|
It's not wip anymore and should be easy to review/test if you have the hardware :) |
e8d611c to
4006e89
Compare
|
rebased (there was a conflict because #12902 was just merged) |
fjmolinas
left a comment
There was a problem hiding this comment.
Changes look good to me, reduces code duplication and is more inline with out coding styles. One minor comment otherwise looks good. Tested with tests/shell and tests/stdin.
- Master:
text data bss dec hex filename
11746 136 2472 14354 3812 /data/riotbuild/riotbase/tests/stdin/bin/hifive1b/tests_stdin.elf
- PR:
text data bss dec hex filename
11730 136 2472 14338 3802 /data/riotbuild/riotbase/tests/stdin/bin/hifive1b/tests_stdin.elf
| for (size_t i = 0; i < len; i++) { | ||
| /* Wait for FIFO to empty */ | ||
| while ((_REG32(uart_config[dev].addr, UART_REG_TXFIFO) & UART_TXFIFO_FULL) | ||
| == (uint32_t)UART_TXFIFO_FULL) {}; |
There was a problem hiding this comment.
Yes, it doesn't build without ("error: comparison of integer expressions of different signedness")
|
Ok to squash @fjmolinas ? Regarding the code size increase, it will be greatly compensated when #12934 is merged. |
|
please squash! |
6d353ba to
8768242
Compare
Contribution description
While working on #12891, I noticed that the UART driver of the fe310 CPU would need some improvement:
This PR fixes all these problems while keeping the UART working. This PR is also saving some ROM memory (40B):Strange, the ROM size is increased now. Need to investigate...
Testing procedure
Issues/PRs references
None