Use NUM_DIGITAL_PINS instead of custom DIO_COUNT

This commit is contained in:
Scott Lahteine 2016-10-31 07:36:01 -05:00
parent 04a1fac029
commit ff3a8ca0d1
2 changed files with 2 additions and 19 deletions

View File

@ -4700,10 +4700,10 @@ inline void gcode_M42() {
} }
// Get the range of pins to test or watch // Get the range of pins to test or watch
int first_pin = 0, last_pin = DIO_COUNT - 1; int first_pin = 0, last_pin = NUM_DIGITAL_PINS - 1;
if (code_seen('P')) { if (code_seen('P')) {
first_pin = last_pin = code_value_byte(); first_pin = last_pin = code_value_byte();
if (first_pin > DIO_COUNT - 1) return; if (first_pin > NUM_DIGITAL_PINS - 1) return;
} }
bool ignore_protection = code_seen('I') ? code_value_bool() : false; bool ignore_protection = code_seen('I') ? code_value_bool() : false;

View File

@ -20,20 +20,6 @@
* *
*/ */
// How many DIO pins are defined?
#ifdef DIO85_PIN
// #define DIO_COUNT 86
#define DIO_COUNT 70 // digitalRead and other Arduino IDE routines only know about pins 0 through 69
#elif defined(DIO53_PIN)
#define DIO_COUNT 54
#elif defined(DIO47_PIN)
#define DIO_COUNT 48
#elif defined(DIO31_PIN)
#define DIO_COUNT 32
#elif defined(DIO21_PIN)
#define DIO_COUNT 22
#endif
bool endstop_monitor_flag = false; bool endstop_monitor_flag = false;
#define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names #define NAME_FORMAT "%-28s" // one place to specify the format of all the sources of names
@ -157,9 +143,6 @@ static bool report_pin_name(int8_t pin, bool &pin_is_analog) {
#if PIN_EXISTS(DIGIPOTSS) #if PIN_EXISTS(DIGIPOTSS)
PIN_SAY(DIGIPOTSS_PIN); PIN_SAY(DIGIPOTSS_PIN);
#endif #endif
#if defined(DIO_COUNT) && DIO_COUNT >= 0
PIN_SAY(DIO_COUNT);
#endif
#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0 #if defined(DOGLCD_A0) && DOGLCD_A0 >= 0
PIN_SAY(DOGLCD_A0); PIN_SAY(DOGLCD_A0);
#endif #endif