Commit d227957
committed
SerialX.begin - support 7 bit modes.
As per the forum thread:
https://forum.arduino.cc/t/uno-r4-and-serial1-different-nr-databits/1192974/9
Sketches that tried to use the standard modes such as Serial_7E1
Would not work and sounds like they would hang.
This sketch simply duplicated the 8 bit modes, in the switch statement, and changed _8 to _7...
So for example:
```
case SERIAL_7E1:
uart_cfg.data_bits = UART_DATA_BITS_7;
uart_cfg.parity = UART_PARITY_EVEN;
uart_cfg.stop_bits = UART_STOP_BITS_1;
break;
```
There was already support for handling this in the FSP layer.
I verified that 7E1 and 7O1 worked using logic analyzer. Also verified that the standard 8N1 still worked.
Note: The ArduinoCore-API file HardwareSerial.h has many other defined modes, which are probably
not supported, on the UNO R4, such as: SERIAL_5E2
Which the switch statement still does not handle, and the uart_cfg items will not be set...
But that is beyond this fix.1 parent 1169821 commit d227957
1 file changed
+32
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
263 | 295 | | |
264 | 296 | | |
265 | 297 | | |
| |||
0 commit comments