Skip to content

Commit

Permalink
Merge pull request #1 from MarlinFirmware/bugfix-2.0.x
Browse files Browse the repository at this point in the history
Move pins debug condition
  • Loading branch information
Vertabreak authored Dec 20, 2019
2 parents e3b0275 + 64ebec5 commit 6fa4ff6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Marlin/src/HAL/HAL_AVR/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,19 +38,23 @@
#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)
#define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
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)
Expand Down
6 changes: 0 additions & 6 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6fa4ff6

Please sign in to comment.