Open ledvinap opened 3 weeks ago
Do you want to test this code? You can flash it directly from Betaflight Configurator:
#13585
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
A bit bigger PR .. but it removes ~930 lines of code (generated serial_post.h is 530 lines)
I can cleanup it a bit or remove more controversial parts.
Impressive amount of work. Have you tested DMA operation? This is code we don’t use and so isn’t tested at the moment, but in future and with more DMA channels this may be resurrected.
@SteveCEvans : DMA should be unchanged (same enums, with possibly different values). I'll double-check it.
serial - refactor serial resource handling
serial - merge code duplicated in all UART implementations
serial - refactor uartDevice
serialPortIdentifier_e identifier;
for uartHardwareserial - apply changes to inverter New implementation is trivial
serial - HAL - rxIrq, txIrq replaces by irqn There is only one IRQ for serial
serial - serial_post.h Generated code to normalize target configuration. jinja2 template is used to generate header file. Port handling is unified a lot.
SERIAL_<type><n>_USED 0/1
- always defined, value depends on target configurationSERIAL_<type>_MASK
- bitmask of used ports or given type.SERIAL_<type>_COUNT
- number of enabled ports of given typeSERIAL_<type>_MAX
-targets - remove automatically calculated valued from configs serial_post.h generated them
serial - remove definitions replaced by serial_post.h
serial - change LPUART to UART_LP1 in places LPUART is mostly handled as another UART port, this change reflects it
serial - use ARRAYLEN / ARRAYEND in some places replaces constant that may not match actual array size
serial - adapt softserial to changes
serial - whitespace, comments
softserial - fix serialTimerConfigureTimebase
serial - suspicious code
serial - unittests
serial - cleanup
serial - simpler port names Is this useful ?