From 64ebec50dc9dda0615a81d555e78bdf5194f0f78 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Dec 2019 10:19:41 -0600 Subject: [PATCH] Move pins debug condition --- Marlin/src/HAL/HAL_AVR/pinsDebug.h | 7 +++++++ Marlin/src/inc/Conditionals_post.h | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/Marlin/src/HAL/HAL_AVR/pinsDebug.h index e4738e0332..8e083494d9 100644 --- a/Marlin/src/HAL/HAL_AVR/pinsDebug.h +++ b/Marlin/src/HAL/HAL_AVR/pinsDebug.h @@ -26,7 +26,10 @@ #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS +#define AVR_ATmega2560_FAMILY_PLUS_70 MB(BQ_ZUM_MEGA_3D, MIGHTYBOARD_REVE, MINIRAMBO, SCOOVO_X9H) + #if AVR_AT90USB1286_FAMILY + // Working with Teensyduino extension so need to re-define some things #include "pinsDebug_Teensyduino.h" // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs @@ -35,7 +38,9 @@ #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p) #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin)) + #elif AVR_ATmega2560_FAMILY_PLUS_70 // So we can access/display all the pins on boards using more than 70 + #include "pinsDebug_plus_70.h" #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p) #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p) @@ -43,11 +48,13 @@ bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } #else + #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p) #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p) #define digitalPinToPort_DEBUG(p) digitalPinToPort(p) bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); } #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin) + #endif #define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ced854afae..b06523caee 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -26,12 +26,6 @@ * Defines that depend on configuration but are not editable. */ -#define AVR_ATmega2560_FAMILY_PLUS_70 ( \ - MB(BQ_ZUM_MEGA_3D) \ - || MB(MIGHTYBOARD_REVE) \ - || MB(MINIRAMBO) \ - || MB(SCOOVO_X9H) \ -) #ifdef TEENSYDUINO #undef max