@@ -175,11 +175,15 @@ const PinInfo pin_array[] PROGMEM = {
175175#endif
176176
177177static 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" ));
179183}
180184
181185// 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 ) {
183187 char buffer [MAX_NAME_LENGTH + 1 ]; // for the sprintf statements
184188 bool found = false, multi_name_pin = false;
185189
@@ -188,12 +192,12 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
188192 // Use FastIO for pins Teensy doesn't expose
189193 if (pin == 46 ) {
190194 print_input_or_output (IS_OUTPUT (46 ));
191- SERIAL_CHAR ( '0' + READ (46 ));
195+ print_pin_state ( READ (46 ));
192196 return false;
193197 }
194198 else if (pin == 47 ) {
195199 print_input_or_output (IS_OUTPUT (47 ));
196- SERIAL_CHAR ( '0' + READ (47 ));
200+ print_pin_state ( READ (47 ));
197201 return false;
198202 }
199203 #endif
@@ -230,14 +234,14 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
230234 // because this could interfere with inductive/capacitive
231235 // sensors (high impedance voltage divider) and with Pt100 amplifier
232236 print_input_or_output (false);
233- SERIAL_ECHO (digitalRead_mod (pin ));
237+ print_pin_state (digitalRead_mod (pin ));
234238 }
235239 else if (pwm_status (pin )) {
236240 // do nothing
237241 }
238242 else {
239243 print_input_or_output (true);
240- SERIAL_ECHO (digitalRead_mod (pin ));
244+ print_pin_state (digitalRead_mod (pin ));
241245 }
242246 }
243247 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
267271 else if (GET_PINMODE (pin )) {
268272 SERIAL_ECHO_SP (MAX_NAME_LENGTH - 16 );
269273 print_input_or_output (true);
270- SERIAL_ECHO (digitalRead_mod (pin ));
274+ print_pin_state (digitalRead_mod (pin ));
271275 }
272276 else {
273277 if (IS_ANALOG (pin )) {
@@ -279,7 +283,7 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
279283 SERIAL_ECHO_SP (MAX_NAME_LENGTH - 16 ); // add padding if not an analog pin
280284
281285 print_input_or_output (false);
282- SERIAL_ECHO (digitalRead_mod (pin ));
286+ print_pin_state (digitalRead_mod (pin ));
283287 }
284288 //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin
285289 if (extended ) {
0 commit comments