Commit 9a892a9
committed
ports/*: Various changes to implement multiple-output logic.
This is an attempt to implement the following logic:
"mp_hal_stdout_tx_strn() should attempt to write len bytes to all of the
possible destinations for that data, and return the minimum successful
write length"
Implementing this is complicated by these facts:
- multiple outputs may be enabled/disabled at compiled time
- multiple outputs may be enabled/disabled at runtime
- mp_os_dupterm_tx_strn() is one such output, optionally containing
multiple additional outputs
- each of these outputs may or may not be able to report success
- each of these outputs may or may not be able to report partial writes
The result is that there is no single approach that can be followed for
various ports, so each instance of mp_hal_stdout_tx_strn() has its own
logic.
Additionally, cases where "mp_uint_t ret = len;" with len unchanged in the
function, are changed to simply return len. Note that some instances of
mp_hal_stdout_tx_strn() modify len while writing, others don't.
Signed-off-by: Maarten van der Schrieck <maarten@thingsconnected.nl>1 parent 56c35c1 commit 9a892a9
File tree
17 files changed
+90
-45
lines changed- ports
- cc3200/hal
- esp32
- esp8266
- mimxrt
- minimal
- nrf
- drivers
- bluetooth
- usb
- powerpc
- renesas-ra
- rp2
- samd
- stm32
- teensy
- unix
- webassembly
17 files changed
+90
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | 145 | | |
147 | 146 | | |
148 | 147 | | |
| |||
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | | - | |
| 155 | + | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | 123 | | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
140 | | - | |
141 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
140 | 147 | | |
141 | | - | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
240 | | - | |
| 239 | + | |
241 | 240 | | |
242 | 241 | | |
243 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | 200 | | |
202 | 201 | | |
| 202 | + | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
| 132 | + | |
134 | 133 | | |
0 commit comments