@@ -175,11 +175,15 @@ const PinInfo pin_array[] PROGMEM = {
175
175
#endif
176
176
177
177
static void print_input_or_output (const bool isout ) {
178
- SERIAL_ECHOPGM_P (isout ? PSTR ("Output = " ) : PSTR ("Input = " ));
178
+ SERIAL_ECHOF (isout ? F ("Output " ) : F ("Input " ));
179
+ }
180
+
181
+ static void print_pin_state (const bool state ) {
182
+ SERIAL_ECHOF (state ? F ("HIGH" ) : F ("LOW" ));
179
183
}
180
184
181
185
// pretty report with PWM info
182
- inline void report_pin_state_extended (pin_t pin , const bool ignore , const bool extended = false, FSTR_P const start_string = nullptr ) {
186
+ inline void report_pin_state_extended (const pin_t pin , const bool ignore , const bool extended = false, FSTR_P const start_string = nullptr ) {
183
187
char buffer [MAX_NAME_LENGTH + 1 ]; // for the sprintf statements
184
188
bool found = false, multi_name_pin = false;
185
189
@@ -188,12 +192,12 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
188
192
// Use FastIO for pins Teensy doesn't expose
189
193
if (pin == 46 ) {
190
194
print_input_or_output (IS_OUTPUT (46 ));
191
- SERIAL_CHAR ( '0' + READ (46 ));
195
+ print_pin_state ( READ (46 ));
192
196
return false;
193
197
}
194
198
else if (pin == 47 ) {
195
199
print_input_or_output (IS_OUTPUT (47 ));
196
- SERIAL_CHAR ( '0' + READ (47 ));
200
+ print_pin_state ( READ (47 ));
197
201
return false;
198
202
}
199
203
#endif
@@ -230,14 +234,14 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
230
234
// because this could interfere with inductive/capacitive
231
235
// sensors (high impedance voltage divider) and with Pt100 amplifier
232
236
print_input_or_output (false);
233
- SERIAL_ECHO (digitalRead_mod (pin ));
237
+ print_pin_state (digitalRead_mod (pin ));
234
238
}
235
239
else if (pwm_status (pin )) {
236
240
// do nothing
237
241
}
238
242
else {
239
243
print_input_or_output (true);
240
- SERIAL_ECHO (digitalRead_mod (pin ));
244
+ print_pin_state (digitalRead_mod (pin ));
241
245
}
242
246
}
243
247
if (!multi_name_pin && extended ) pwm_details (pin ); // report PWM capabilities only on the first pass & only if doing an extended report
@@ -267,7 +271,7 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
267
271
else if (GET_PINMODE (pin )) {
268
272
SERIAL_ECHO_SP (MAX_NAME_LENGTH - 16 );
269
273
print_input_or_output (true);
270
- SERIAL_ECHO (digitalRead_mod (pin ));
274
+ print_pin_state (digitalRead_mod (pin ));
271
275
}
272
276
else {
273
277
if (IS_ANALOG (pin )) {
@@ -279,7 +283,7 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
279
283
SERIAL_ECHO_SP (MAX_NAME_LENGTH - 16 ); // add padding if not an analog pin
280
284
281
285
print_input_or_output (false);
282
- SERIAL_ECHO (digitalRead_mod (pin ));
286
+ print_pin_state (digitalRead_mod (pin ));
283
287
}
284
288
//if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin
285
289
if (extended ) {
0 commit comments