UART sendbreak bug
There is a bug with the uart.sendbreak() method with V1.17 (haven't checked the latest)
The manual states the break signal lasts 13 bits. It actually is 11.
This has caused errors with external sensors that utilize the SDI-12 protocol. .The line needs to go for at least 12ms. Now, it is 9.167 ms. Even 13 bits is not long enough.
A good solution is to add a property where you can specify how many bits you can use.
SDI-12 is popular in agriculture and other industrial applications. (www.sdi-12.org)
ports/rp2/machine_uart.c: fix handling of serial break condition
The FIFO reports not only the bytes read, but also 4 error bits. These were not checked, leading to NUL value read in case of break and possible garbage bytes being written on parity/framing error.
This patch addresses the issue that NUL bytes are incorrectly read on break, and at least provides the boilerplate code and comments for error handling, that may be implemented in the future. This patch only addresses the rp2 port, but it is likely other ports are also affected by this bug. I am willing to look into that once this PR is accepted.
Note that there are interesting things that can be done with break conditions (e.g. automatically splitting read data on them and/or signalling break to data consuming code), but the first thing is to have at least these error flags checked.