Browse Source

Move pins debug condition

Scott Lahteine 5 years ago
parent
commit
64ebec50dc
2 changed files with 7 additions and 6 deletions
  1. 7
    0
      Marlin/src/HAL/HAL_AVR/pinsDebug.h
  2. 0
    6
      Marlin/src/inc/Conditionals_post.h

+ 7
- 0
Marlin/src/HAL/HAL_AVR/pinsDebug.h View File

26
 
26
 
27
 #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
27
 #define NUMBER_PINS_TOTAL NUM_DIGITAL_PINS
28
 
28
 
29
+#define AVR_ATmega2560_FAMILY_PLUS_70 MB(BQ_ZUM_MEGA_3D, MIGHTYBOARD_REVE, MINIRAMBO, SCOOVO_X9H)
30
+
29
 #if AVR_AT90USB1286_FAMILY
31
 #if AVR_AT90USB1286_FAMILY
32
+
30
   // Working with Teensyduino extension so need to re-define some things
33
   // Working with Teensyduino extension so need to re-define some things
31
   #include "pinsDebug_Teensyduino.h"
34
   #include "pinsDebug_Teensyduino.h"
32
   // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
35
   // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
35
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
38
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
36
   #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
39
   #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
37
   #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
40
   #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
41
+
38
 #elif AVR_ATmega2560_FAMILY_PLUS_70   // So we can access/display all the pins on boards using more than 70
42
 #elif AVR_ATmega2560_FAMILY_PLUS_70   // So we can access/display all the pins on boards using more than 70
43
+
39
   #include "pinsDebug_plus_70.h"
44
   #include "pinsDebug_plus_70.h"
40
   #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
45
   #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
41
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
46
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
43
   bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
48
   bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
44
 
49
 
45
 #else
50
 #else
51
+
46
   #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
52
   #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
47
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
53
   #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
48
   #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
54
   #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
49
   bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
55
   bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
50
   #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
56
   #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
57
+
51
 #endif
58
 #endif
52
 
59
 
53
 #define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
60
 #define VALID_PIN(pin) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)

+ 0
- 6
Marlin/src/inc/Conditionals_post.h View File

26
  * Defines that depend on configuration but are not editable.
26
  * Defines that depend on configuration but are not editable.
27
  */
27
  */
28
 
28
 
29
-#define AVR_ATmega2560_FAMILY_PLUS_70 ( \
30
-     MB(BQ_ZUM_MEGA_3D)                 \
31
-  || MB(MIGHTYBOARD_REVE)               \
32
-  || MB(MINIRAMBO)                      \
33
-  || MB(SCOOVO_X9H)                     \
34
-)
35
 
29
 
36
 #ifdef TEENSYDUINO
30
 #ifdef TEENSYDUINO
37
   #undef max
31
   #undef max

Loading…
Cancel
Save