IRQ driven RX on UART0 #23
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks @kanflo for this contribution!
I have a few thoughts for discussion before merging this. I'm not asking you to necessarily do any of the things here, but it's a good chance to discuss the long-term goals around UART functionality.
There are some parts I'd like to get into esp-open-rtos, probably sooner rather than later:
esp_reg_tmacros for the UART registers, ininclude/esp/registers.h, so no need for the READ_PERI_REG/WRITE_PERI_REG stuff.core/uart.cI also think @foogod's suggestion of minimising bloat/automatically pulled in code is a good one. Relying on the linker for this is (IMHO) good, so weak linking and/or --ffunction-sections and/or having syscalls in their own source files are all good approaches - so you don't link _read_r unless you actually call read() somewhere in your program, etc.
I see UART functionality as "core" functionality to the chip, too, so I'd like to have whatever support is required for good UART interaction included in the core, rather than needing to specify an extra component for it. I see at the moment that you can use just the 'core' and have a busy-waiting read with no buffering, or if you use the extra driver then you get buffering and a cleaner blocking read(), which is clearly a much better configuration.
Anyhow, sorry to dump a bunch of requirements out of the blue! If you're not interesting in making further changes then that's fine, I can probably jump in a give them a shot soon - just let me know.
(Also if you think any of this is a bad idea, let me know about that as well!)
Angus