Commit 0a90c25
Add serial parity option (M575 F) for device/Modbus mode
Aux serial ports in device (Modbus RTU) mode previously always opened as
8N1. Some Modbus devices require parity - e.g. OnRobot grippers need 8E1 -
so add an optional parity setting (#1196).
- AuxDevice: store a SerialParity (none/even/odd) and apply it in SetMode
by selecting Mode_8N1/8E1/8O1 when calling AsyncSerial::begin(baudRate,
config).
- M575: in device mode, parse the F parameter (F0 none/8N1, F1 even/8E1,
F2 odd/8O1). The parameter is applied on every device-mode M575, so
omitting F restores the previous behaviour (8N1) instead of retaining a
previously set parity.
The core (CoreN2G AsyncSerial) already defines the Mode_8E1/8O1 framing,
so no core change is needed. Default stays 8N1, so PanelDue/raw modes are
unaffected.
Enables e.g.: M575 P1 S7 B115200 F1 (Modbus RTU, 115200, 8E1).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent e98afe4 commit 0a90c25
3 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2303 | 2303 | | |
2304 | 2304 | | |
2305 | 2305 | | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
2306 | 2314 | | |
2307 | 2315 | | |
2308 | 2316 | | |
| |||
0 commit comments