🐛 Fix LPC176x M43 Pins Debugging (#22611)

This commit is contained in:
Chris Pepper
2021-08-22 22:47:37 +01:00
committed by Scott Lahteine
parent 73ef26a106
commit d8ef23eda7
11 changed files with 22 additions and 18 deletions

View File

@ -203,11 +203,8 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
SERIAL_ECHOPGM("PIN: ");
PRINT_PIN(pin);
PRINT_PORT(pin);
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) {
sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number
SERIAL_ECHO(buffer);
}
else SERIAL_ECHO_SP(8); // add padding if not an analog pin
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) PRINT_PIN_ANALOG(pin); // analog pin number
else SERIAL_ECHO_SP(8); // add padding if not an analog pin
}
else {
SERIAL_CHAR('.');
@ -254,12 +251,8 @@ inline void report_pin_state_extended(pin_t pin, const bool ignore, const bool e
SERIAL_ECHOPGM("PIN: ");
PRINT_PIN(pin);
PRINT_PORT(pin);
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) {
sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); // analog pin number
SERIAL_ECHO(buffer);
}
else
SERIAL_ECHO_SP(8); // add padding if not an analog pin
if (int8_t(DIGITAL_PIN_TO_ANALOG_PIN(pin)) >= 0) PRINT_PIN_ANALOG(pin); // analog pin number
else SERIAL_ECHO_SP(8); // add padding if not an analog pin
SERIAL_ECHOPGM("<unused/unknown>");
if (extended) {

View File

@ -24,14 +24,18 @@
// Pin lists 1.1.x and 2.0.x synchronized 2018-02-17
#line 28 // set __LINE__ to a known value for both passes
#if TARGET_LPC1768
#define ANALOG_OK(PN) ((PN) == P0_02 || (PN) == P0_03 || (PN) == P0_23 || (PN) == P0_24 || (PN) == P0_25 || (PN) == P0_26 || (PN) == P1_30 || (PN) == P1_31)
#else
#define ANALOG_OK(PN) ((PN) >= 0 && (PN) < NUM_ANALOG_INPUTS)
#endif
#line 34 // set __LINE__ to a known value for both passes
//
// Analog Pin Assignments
//
#define ANALOG_OK(PN) ((PN) >= 0 && (PN) < NUM_ANALOG_INPUTS)
#if defined(EXT_AUX_A0) && ANALOG_OK(EXT_AUX_A0)
REPORT_NAME_ANALOG(__LINE__, EXT_AUX_A0)
#endif