Browse Source

HAL compatible pinsDebug & misc

Re-ARM has been tested.  AVR has not been tested.

1) moved all cpu specific items to files in the low level HAL directory
for that CPU (pinDebug_Re-ARM.h & pinsDebug_AVR_8_bit.h

2) added pinsDebug.h to the top level directory

3) modified HAL_pinsDebug.h to select the correct support file for the
selected CPU

4) Patched sanitycheck to stop throwing false errors.  A long term
solution will be done

5) misc changes & bug fixes
arduino.cpp - included macros.h to fix a missing definition
pinmap_re-arm.h - removed a duplicated line.
pinmapping.h - changed from "ENABLED" to "defined" to fix a compile
error

======================================================================

split SanityCheck up, improve pinsDebug system

======================================================================

switch to latest pins_RAMPS_RE_ARM.h
Bob-the-Kuhn 7 years ago
parent
commit
84a11cfedc

+ 1
- 1
Marlin/Marlin_main.cpp View File

@@ -6632,7 +6632,7 @@ inline void gcode_M42() {
6632 6632
 
6633 6633
 #if ENABLED(PINS_DEBUGGING)
6634 6634
 
6635
-  #include "src/HAL/HAL_pinsDebug.h"
6635
+  #include "pinsDebug.h"
6636 6636
 
6637 6637
   inline void toggle_pins() {
6638 6638
     const bool I_flag = parser.boolval('I');

+ 2
- 70
Marlin/SanityCheck.h View File

@@ -1284,16 +1284,6 @@ static_assert(1 >= 0
1284 1284
 #endif
1285 1285
 
1286 1286
 /**
1287
- * Digipot requirement
1288
- */
1289
-#if ENABLED(DIGIPOT_MCP4018)
1290
-  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
1291
-    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
1292
-      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
1293
-  #endif
1294
-#endif
1295
-
1296
-/**
1297 1287
  * Require 4 or more elements in per-axis initializers
1298 1288
  */
1299 1289
 constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT,
@@ -1306,63 +1296,5 @@ static_assert(COUNT(sanity_arr_1) <= XYZE_N, "DEFAULT_AXIS_STEPS_PER_UNIT has to
1306 1296
 static_assert(COUNT(sanity_arr_2) <= XYZE_N, "DEFAULT_MAX_FEEDRATE has too many elements.");
1307 1297
 static_assert(COUNT(sanity_arr_3) <= XYZE_N, "DEFAULT_MAX_ACCELERATION has too many elements.");
1308 1298
 
1309
-/**
1310
- * Sanity checks for Spindle / Laser
1311
- */
1312
-#if ENABLED(SPINDLE_LASER_ENABLE)
1313
-  #if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
1314
-    #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
1315
-  #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR)
1316
-    #error "SPINDLE_DIR_PIN not defined."
1317
-  #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM)
1318
-    #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46))
1319
-      #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
1320
-    #elif SPINDLE_LASER_POWERUP_DELAY < 1
1321
-      #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
1322
-    #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
1323
-      #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
1324
-    #elif !defined(SPINDLE_LASER_PWM_INVERT)
1325
-      #error "SPINDLE_LASER_PWM_INVERT missing."
1326
-    #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
1327
-      #error "SPINDLE_LASER_PWM equation constant(s) missing."
1328
-    #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
1329
-      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
1330
-    #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN
1331
-      #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop."
1332
-    #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN
1333
-      #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop."
1334
-    #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN
1335
-      #error "SPINDLE_LASER_PWM pin in use by Z_STEP."
1336
-    #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
1337
-      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
1338
-    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
1339
-      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN."
1340
-    #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN
1341
-      #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN."
1342
-    #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN
1343
-      #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN."
1344
-    #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN
1345
-      #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN."
1346
-    #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN
1347
-      #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN."
1348
-    #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN
1349
-      #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN."
1350
-    #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN
1351
-      #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN."
1352
-    #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN
1353
-      #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN."
1354
-    #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN
1355
-      #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN."
1356
-    #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN
1357
-      #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN."
1358
-    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN
1359
-      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY."
1360
-    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN
1361
-      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z."
1362
-    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN
1363
-      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E."
1364
-    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
1365
-      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT."
1366
-    #endif
1367
-  #endif
1368
-#endif // SPINDLE_LASER_ENABLE
1299
+
1300
+#include "src/HAL/HAL_SanityCheck.h"  // get CPU specific checks

Marlin/src/HAL/HAL_LPC1768/HAL_pinsDebug.h → Marlin/pinsDebug.h View File

@@ -1,6 +1,6 @@
1 1
 /**
2 2
  * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 4
  *
5 5
  * Based on Sprinter and grbl.
6 6
  * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
@@ -44,8 +44,14 @@ bool endstop_monitor_flag = false;
44 44
 #define REPORT_NAME_DIGITAL(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
45 45
 #define REPORT_NAME_ANALOG(NAME, COUNTER) _ADD_PIN(#NAME, COUNTER)
46 46
 
47
-#include "../../../pinsDebug_list.h"
48
-#line 51
47
+#include "pinsDebug_list.h"
48
+#line 49
49
+
50
+// manually add pins that have names that are macros which don't play well with these macros
51
+#if SERIAL_PORT == 0 && (AVR_ATmega2560_FAMILY || AVR_ATmega1284_FAMILY)
52
+  static const char RXD_NAME[] PROGMEM = { "RXD" };
53
+  static const char TXD_NAME[] PROGMEM = { "TXD" };
54
+#endif
49 55
 
50 56
 /////////////////////////////////////////////////////////////////////////////
51 57
 
@@ -81,41 +87,34 @@ const PinInfo pin_array[] PROGMEM = {
81 87
 
82 88
   // manually add pins ...
83 89
   #if SERIAL_PORT == 0
84
-
90
+    #if AVR_ATmega2560_FAMILY
91
+      { RXD_NAME, 0, true },
92
+      { TXD_NAME, 1, true },
93
+    #elif AVR_ATmega1284_FAMILY
94
+      { RXD_NAME, 8, true },
95
+      { TXD_NAME, 9, true },
96
+    #endif
85 97
   #endif
86 98
 
87
-  #include "../../../pinsDebug_list.h"
88
-  #line 102
99
+  #include "pinsDebug_list.h"
100
+  #line 101
89 101
 
90 102
 };
91 103
 
92
-#define AVR_ATmega2560_FAMILY_PLUS_70 (MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D \
93
-|| MOTHERBOARD == BOARD_MIGHTYBOARD_REVE \
94
-|| MOTHERBOARD == BOARD_MINIRAMBO \
95
-|| MOTHERBOARD == BOARD_SCOOVO_X9H)
96
-
97 104
 
98
-#include "pinsDebug_Re_ARM.h"
105
+#include "src/HAL/HAL_pinsDebug.h"  // get the correct support file for this CPU
99 106
 
100
-#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM:  %4d"), V); SERIAL_ECHO(buffer); }while(0)
101
-#define PWM_CASE(N,Z)                                           \
102
-  case TIMER##N##Z:                                             \
103
-    if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \
104
-      PWM_PRINT(OCR##N##Z);                                     \
105
-      return true;                                              \
106
-    } else return false
107
-
108
-bool PWM_ok = true;
109 107
 
110 108
 static void print_input_or_output(const bool isout) {
111 109
   serialprintPGM(isout ? PSTR("Output = ") : PSTR("Input  = "));
112 110
 }
113 111
 
112
+
114 113
 // pretty report with PWM info
115 114
 inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = false, const char *start_string = "") {
116
-  uint8_t temp_char;
117
-  char *name_mem_pointer, buffer[30];   // for the sprintf statements
115
+  char buffer[30];   // for the sprintf statements
118 116
   bool found = false, multi_name_pin = false;
117
+
119 118
   for (uint8_t x = 0; x < COUNT(pin_array); x++)  {    // scan entire array and report all instances of this pin
120 119
     if (GET_ARRAY_PIN(x) == pin) {
121 120
       GET_PIN_INFO(pin);
@@ -140,35 +139,42 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f
140 139
         if (pin_is_protected(pin) && !ignore)
141 140
           SERIAL_ECHOPGM("protected ");
142 141
         else {
143
-//SERIAL_PROTOCOLPAIR(" GET_ARRAY_IS_DIGITAL(x) 0 = analog : ", GET_ARRAY_IS_DIGITAL(x));           
144
-
145
-          if (!GET_ARRAY_IS_DIGITAL(x)) {
146
-            sprintf_P(buffer, PSTR("Analog in = %5d"), analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)));
147
-            SERIAL_ECHO(buffer);
148
-          }
149
-          else {
150
-
151
-//MYSERIAL.printf("  GET_PINMODE(pin) 1 = output : %d   ", GET_PINMODE(pin));           
152
-            if (!GET_PINMODE(pin)) {
153
-              //pinMode(pin, INPUT_PULLUP);  // make sure input isn't floating - stopped doing this
154
-                                             // because this could interfere with inductive/capacitive
155
-                                             // sensors (high impedance voltage divider) and with PT100 amplifier
156
-              print_input_or_output(false);
157
-              SERIAL_PROTOCOL(digitalRead_mod(pin));
142
+          #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO
143
+            if (pin == 46 || pin == 47) {
144
+              if (pin == 46) {
145
+                print_input_or_output(GET_OUTPUT(46));
146
+                SERIAL_PROTOCOL(READ(46));
147
+              }
148
+              else if (pin == 47) {
149
+                print_input_or_output(GET_OUTPUT(47));
150
+                SERIAL_PROTOCOL(READ(47));
151
+              }
152
+            }
153
+            else
154
+          #endif
155
+          {
156
+            if (!GET_ARRAY_IS_DIGITAL(x)) {
157
+              sprintf_P(buffer, PSTR("Analog in = %5d"), analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)));
158
+              SERIAL_ECHO(buffer);
158 159
             }
159
-            #if PWM_ok
160
+            else {
161
+              if (!GET_PINMODE(pin)) {
162
+                //pinMode(pin, INPUT_PULLUP);  // make sure input isn't floating - stopped doing this
163
+                                               // because this could interfere with inductive/capacitive
164
+                                               // sensors (high impedance voltage divider) and with PT100 amplifier
165
+                print_input_or_output(false);
166
+                SERIAL_PROTOCOL(digitalRead_mod(pin));
167
+              }
160 168
               else if (pwm_status(pin)) {
161 169
                 // do nothing
162 170
               }
163
-              #endif
164
-            else {
165
-              print_input_or_output(true);
166
-              SERIAL_PROTOCOL(digitalRead_mod(pin));
171
+              else {
172
+                print_input_or_output(true);
173
+                SERIAL_PROTOCOL(digitalRead_mod(pin));
174
+              }
167 175
             }
168
-          }
169
-          #if PWM_ok
170 176
             if (!multi_name_pin && extended) pwm_details(pin);  // report PWM capabilities only on the first pass & only if doing an extended report
171
-          #endif
177
+          }
172 178
         }
173 179
       }
174 180
       SERIAL_EOL();
@@ -176,7 +182,6 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f
176 182
   } // end of for loop
177 183
 
178 184
   if (!found) {
179
-    GET_PIN_INFO(pin);
180 185
     sprintf_P(buffer, PSTR("%sPIN: %3d "), start_string, pin);
181 186
     SERIAL_ECHO(buffer);
182 187
     PRINT_PORT(pin);
@@ -188,27 +193,41 @@ inline void report_pin_state_extended(int8_t pin, bool ignore, bool extended = f
188 193
       SERIAL_ECHO_SP(8);   // add padding if not an analog pin
189 194
     SERIAL_ECHOPGM("<unused/unknown>");
190 195
     if (extended) {
191
-      if (GET_PINMODE(pin)) {
192
-        SERIAL_PROTOCOL_SP(MAX_NAME_LENGTH - 16);
193
-        print_input_or_output(true);
194
-        SERIAL_PROTOCOL(digitalRead_mod(pin));
195
-      }
196
-      else {
197
-        if (IS_ANALOG(pin)) {
198
-          sprintf_P(buffer, PSTR("   Analog in = %5d"), analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)));
199
-          SERIAL_ECHO(buffer);
200
-          SERIAL_ECHOPGM("   ");
196
+      #if AVR_AT90USB1286_FAMILY  //Teensy IDEs don't know about these pins so must use FASTIO
197
+        if (pin == 46 || pin == 47) {
198
+          SERIAL_PROTOCOL_SP(12);
199
+          if (pin == 46) {
200
+            print_input_or_output(GET_OUTPUT(46));
201
+            SERIAL_PROTOCOL(READ(46));
202
+          }
203
+          else {
204
+            print_input_or_output(GET_OUTPUT(47));
205
+            SERIAL_PROTOCOL(READ(47));
206
+          }
201 207
         }
202 208
         else
203
-        SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16);   // add padding if not an analog pin
209
+      #endif
210
+      {
211
+        if (GET_PINMODE(pin)) {
212
+          SERIAL_PROTOCOL_SP(MAX_NAME_LENGTH - 16);
213
+          print_input_or_output(true);
214
+          SERIAL_PROTOCOL(digitalRead_mod(pin));
215
+        }
216
+        else {
217
+          if (IS_ANALOG(pin)) {
218
+            sprintf_P(buffer, PSTR("   Analog in = %5d"), analogRead(DIGITAL_PIN_TO_ANALOG_PIN(pin)));
219
+            SERIAL_ECHO(buffer);
220
+            SERIAL_ECHOPGM("   ");
221
+          }
222
+          else
223
+          SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16);   // add padding if not an analog pin
204 224
 
205
-        print_input_or_output(false);
206
-        SERIAL_PROTOCOL(digitalRead_mod(pin));
207
-      }
208
-      //if (!pwm_status(pin)) SERIAL_CHAR(' ');    // add padding if it's not a PWM pin
209
-      #if PWM_ok
225
+          print_input_or_output(false);
226
+          SERIAL_PROTOCOL(digitalRead_mod(pin));
227
+        }
228
+        //if (!pwm_status(pin)) SERIAL_CHAR(' ');    // add padding if it's not a PWM pin
210 229
         if (extended) pwm_details(pin);  // report PWM capabilities only if doing an extended report
211
-      #endif
230
+      }
212 231
     }
213 232
     SERIAL_EOL();
214 233
   }

+ 286
- 236
Marlin/pinsDebug_list.h View File

@@ -11,7 +11,7 @@
11 11
  * (at your option) any later version.
12 12
  *
13 13
  * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * but WITHOUT ANY WARRANTY without even the implied warranty of
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
17 17
  *
@@ -25,77 +25,119 @@
25 25
 // Following this pattern is a must.
26 26
 // If the new pin name is over 28 characters long then pinsDebug.h will need to be modified.
27 27
 
28
-// Pin list updated from 18 FEB 2017 RCBugfix branch   - max length of pin name is 24
28
+// Pin list updated from 25 JUL 2017 Re-ARM branch   - max length of pin name is 24
29 29
 
30 30
 #line 0 // set __LINE__ to a known value for both passes
31 31
 
32
-#if PIN_EXISTS(ADC_KEYPAD) && ADC_KEYPAD_PIN < NUM_ANALOG_INPUTS
33
-  REPORT_NAME_ANALOG(ADC_KEYPAD_PIN, __LINE__ )
32
+#if defined(EXT_AUX_A0) &&  EXT_AUX_A0 >= 0 &&  EXT_AUX_A0 < NUM_ANALOG_INPUTS
33
+  REPORT_NAME_ANALOG(EXT_AUX_A0, __LINE__ )
34
+#endif
35
+#if defined(EXT_AUX_A1) &&  EXT_AUX_A1 >= 0 &&  EXT_AUX_A1 < NUM_ANALOG_INPUTS
36
+  REPORT_NAME_ANALOG(EXT_AUX_A1, __LINE__ )
37
+#endif
38
+#if defined(EXT_AUX_A2) &&  EXT_AUX_A2 >= 0 &&  EXT_AUX_A2 < NUM_ANALOG_INPUTS
39
+  REPORT_NAME_ANALOG(EXT_AUX_A2, __LINE__ )
40
+#endif
41
+#if defined(EXT_AUX_A3) &&  EXT_AUX_A3 >= 0 &&  EXT_AUX_A3 < NUM_ANALOG_INPUTS
42
+  REPORT_NAME_ANALOG(EXT_AUX_A3, __LINE__ )
43
+#endif
44
+#if defined(EXT_AUX_A4) &&  EXT_AUX_A4 >= 0 &&  EXT_AUX_A4 < NUM_ANALOG_INPUTS
45
+  REPORT_NAME_ANALOG(EXT_AUX_A4, __LINE__ )
46
+#endif
47
+#if PIN_EXISTS(FILWIDTH) &&  FILWIDTH_PIN < NUM_ANALOG_INPUTS
48
+  REPORT_NAME_ANALOG(FILWIDTH_PIN, __LINE__ )
49
+#endif
50
+#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) &&  MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS
51
+  REPORT_NAME_ANALOG(MAIN_VOLTAGE_MEASURE_PIN, __LINE__ )
52
+#endif
53
+#if defined(TC1) &&  TC1 >= 0 &&  TC1 < NUM_ANALOG_INPUTS
54
+  REPORT_NAME_ANALOG(TC1, __LINE__ )
55
+#endif
56
+#if defined(TC2) &&  TC2 >= 0 &&  TC2 < NUM_ANALOG_INPUTS
57
+  REPORT_NAME_ANALOG(TC2, __LINE__ )
58
+#endif
59
+#if PIN_EXISTS(TEMP_0) &&  TEMP_0_PIN < NUM_ANALOG_INPUTS
60
+  REPORT_NAME_ANALOG(TEMP_0_PIN, __LINE__ )
34 61
 #endif
35
-#if defined(__FD) && __FD >= 0
62
+#if PIN_EXISTS(TEMP_1) &&  TEMP_1_PIN < NUM_ANALOG_INPUTS
63
+  REPORT_NAME_ANALOG(TEMP_1_PIN, __LINE__ )
64
+#endif
65
+#if PIN_EXISTS(TEMP_2) &&  TEMP_2_PIN < NUM_ANALOG_INPUTS
66
+  REPORT_NAME_ANALOG(TEMP_2_PIN, __LINE__ )
67
+#endif
68
+#if PIN_EXISTS(TEMP_3) &&  TEMP_3_PIN < NUM_ANALOG_INPUTS
69
+  REPORT_NAME_ANALOG(TEMP_3_PIN, __LINE__ )
70
+#endif
71
+#if PIN_EXISTS(TEMP_4) &&  TEMP_4_PIN < NUM_ANALOG_INPUTS
72
+  REPORT_NAME_ANALOG(TEMP_4_PIN, __LINE__ )
73
+#endif
74
+#if PIN_EXISTS(TEMP_BED) &&  TEMP_BED_PIN < NUM_ANALOG_INPUTS
75
+  REPORT_NAME_ANALOG(TEMP_BED_PIN, __LINE__ )
76
+#endif
77
+#if PIN_EXISTS(TEMP_CHAMBER) &&  TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS
78
+  REPORT_NAME_ANALOG(TEMP_CHAMBER_PIN, __LINE__ )
79
+#endif
80
+#if PIN_EXISTS(TEMP_X) &&  TEMP_X_PIN < NUM_ANALOG_INPUTS
81
+  REPORT_NAME_ANALOG(TEMP_X_PIN, __LINE__ )
82
+#endif
83
+#if defined(__FD) &&  __FD >= 0
36 84
   REPORT_NAME_DIGITAL(__FD, __LINE__ )
37 85
 #endif
38
-#if defined(__FS) && __FS >= 0
86
+#if defined(__FS) &&  __FS >= 0
39 87
   REPORT_NAME_DIGITAL(__FS, __LINE__ )
40 88
 #endif
41
-#if defined(__GD) && __GD >= 0
89
+#if defined(__GD) &&  __GD >= 0
42 90
   REPORT_NAME_DIGITAL(__GD, __LINE__ )
43 91
 #endif
44
-#if defined(__GS) && __GS >= 0
92
+#if defined(__GS) &&  __GS >= 0
45 93
   REPORT_NAME_DIGITAL(__GS, __LINE__ )
46 94
 #endif
47 95
 #if PIN_EXISTS(ADC_KEYPAD)
48
-  REPORT_NAME_ANALOG(ADC_KEYPAD_PIN, __LINE__ )
96
+  REPORT_NAME_DIGITAL(ADC_KEYPAD_PIN, __LINE__ )
49 97
 #endif
50
-#if PIN_EXISTS(AVR_MISO)
51
-  REPORT_NAME_DIGITAL(AVR_MISO_PIN, __LINE__ )
52
-#endif
53
-#if PIN_EXISTS(AVR_MOSI)
54
-  REPORT_NAME_DIGITAL(AVR_MOSI_PIN, __LINE__ )
55
-#endif
56
-#if PIN_EXISTS(AVR_SCK)
57
-  REPORT_NAME_DIGITAL(AVR_SCK_PIN, __LINE__ )
58
-#endif
59
-#if PIN_EXISTS(AVR_SS)
60
-  REPORT_NAME_DIGITAL(AVR_SS_PIN, __LINE__ )
98
+#if PIN_EXISTS(ALARM)
99
+  REPORT_NAME_DIGITAL(ALARM_PIN, __LINE__ )
61 100
 #endif
62 101
 #if PIN_EXISTS(BEEPER)
63 102
   REPORT_NAME_DIGITAL(BEEPER_PIN, __LINE__ )
64 103
 #endif
65
-#if defined(BTN_CENTER) && BTN_CENTER >= 0
104
+#if defined(BTN_BACK) &&  BTN_BACK >= 0
105
+  REPORT_NAME_DIGITAL(BTN_BACK, __LINE__ )
106
+#endif
107
+#if defined(BTN_CENTER) &&  BTN_CENTER >= 0
66 108
   REPORT_NAME_DIGITAL(BTN_CENTER, __LINE__ )
67 109
 #endif
68
-#if defined(BTN_DOWN) && BTN_DOWN >= 0
110
+#if defined(BTN_DOWN) &&  BTN_DOWN >= 0
69 111
   REPORT_NAME_DIGITAL(BTN_DOWN, __LINE__ )
70 112
 #endif
71
-#if defined(BTN_DWN) && BTN_DWN >= 0
113
+#if defined(BTN_DWN) &&  BTN_DWN >= 0
72 114
   REPORT_NAME_DIGITAL(BTN_DWN, __LINE__ )
73 115
 #endif
74
-#if defined(BTN_EN1) && BTN_EN1 >= 0
116
+#if defined(BTN_EN1) &&  BTN_EN1 >= 0
75 117
   REPORT_NAME_DIGITAL(BTN_EN1, __LINE__ )
76 118
 #endif
77
-#if defined(BTN_EN2) && BTN_EN2 >= 0
119
+#if defined(BTN_EN2) &&  BTN_EN2 >= 0
78 120
   REPORT_NAME_DIGITAL(BTN_EN2, __LINE__ )
79 121
 #endif
80
-#if defined(BTN_ENC) && BTN_ENC >= 0
122
+#if defined(BTN_ENC) &&  BTN_ENC >= 0
81 123
   REPORT_NAME_DIGITAL(BTN_ENC, __LINE__ )
82 124
 #endif
83
-#if defined(BTN_HOME) && BTN_HOME >= 0
125
+#if defined(BTN_HOME) &&  BTN_HOME >= 0
84 126
   REPORT_NAME_DIGITAL(BTN_HOME, __LINE__ )
85 127
 #endif
86
-#if defined(BTN_LEFT) && BTN_LEFT >= 0
128
+#if defined(BTN_LEFT) &&  BTN_LEFT >= 0
87 129
   REPORT_NAME_DIGITAL(BTN_LEFT, __LINE__ )
88 130
 #endif
89
-#if defined(BTN_LFT) && BTN_LFT >= 0
131
+#if defined(BTN_LFT) &&  BTN_LFT >= 0
90 132
   REPORT_NAME_DIGITAL(BTN_LFT, __LINE__ )
91 133
 #endif
92
-#if defined(BTN_RIGHT) && BTN_RIGHT >= 0
134
+#if defined(BTN_RIGHT) &&  BTN_RIGHT >= 0
93 135
   REPORT_NAME_DIGITAL(BTN_RIGHT, __LINE__ )
94 136
 #endif
95
-#if defined(BTN_RT) && BTN_RT >= 0
137
+#if defined(BTN_RT) &&  BTN_RT >= 0
96 138
   REPORT_NAME_DIGITAL(BTN_RT, __LINE__ )
97 139
 #endif
98
-#if defined(BTN_UP) && BTN_UP >= 0
140
+#if defined(BTN_UP) &&  BTN_UP >= 0
99 141
   REPORT_NAME_DIGITAL(BTN_UP, __LINE__ )
100 142
 #endif
101 143
 #if PIN_EXISTS(CASE_LIGHT)
@@ -110,54 +152,72 @@
110 152
 #if PIN_EXISTS(CUTOFF_TEST)
111 153
   REPORT_NAME_DIGITAL(CUTOFF_TEST_PIN, __LINE__ )
112 154
 #endif
155
+#if defined(D57) &&  D57 >= 0
156
+  REPORT_NAME_DIGITAL(D57, __LINE__ )
157
+#endif
158
+#if defined(D58) &&  D58 >= 0
159
+  REPORT_NAME_DIGITAL(D58, __LINE__ )
160
+#endif
113 161
 #if PIN_EXISTS(DAC_DISABLE)
114 162
   REPORT_NAME_DIGITAL(DAC_DISABLE_PIN, __LINE__ )
115 163
 #endif
116
-#if defined(DAC_STEPPER_VREF) && DAC_STEPPER_VREF >= 0
117
-  REPORT_NAME_DIGITAL(DAC_STEPPER_VREF, __LINE__ )
164
+#if defined(DAC0_SYNC) &&  DAC0_SYNC >= 0
165
+  REPORT_NAME_DIGITAL(DAC0_SYNC, __LINE__ )
166
+#endif
167
+#if defined(DAC1_SYNC) &&  DAC1_SYNC >= 0
168
+  REPORT_NAME_DIGITAL(DAC1_SYNC, __LINE__ )
118 169
 #endif
119 170
 #if PIN_EXISTS(DEBUG)
120 171
   REPORT_NAME_DIGITAL(DEBUG_PIN, __LINE__ )
121 172
 #endif
122
-#if defined(DIGIPOTS_I2C_SCL) && DIGIPOTS_I2C_SCL >= 0
173
+#if defined(DIGIPOTS_I2C_SCL) &&  DIGIPOTS_I2C_SCL >= 0
123 174
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SCL, __LINE__ )
124 175
 #endif
125
-#if defined(DIGIPOTS_I2C_SDA_E0) && DIGIPOTS_I2C_SDA_E0 >= 0
176
+#if defined(DIGIPOTS_I2C_SDA_E0) &&  DIGIPOTS_I2C_SDA_E0 >= 0
126 177
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E0, __LINE__ )
127 178
 #endif
128
-#if defined(DIGIPOTS_I2C_SDA_E1) && DIGIPOTS_I2C_SDA_E1 >= 0
179
+#if defined(DIGIPOTS_I2C_SDA_E1) &&  DIGIPOTS_I2C_SDA_E1 >= 0
129 180
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_E1, __LINE__ )
130 181
 #endif
131
-#if defined(DIGIPOTS_I2C_SDA_X) && DIGIPOTS_I2C_SDA_X >= 0
182
+#if defined(DIGIPOTS_I2C_SDA_X) &&  DIGIPOTS_I2C_SDA_X >= 0
132 183
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_X, __LINE__ )
133 184
 #endif
134
-#if defined(DIGIPOTS_I2C_SDA_Y) && DIGIPOTS_I2C_SDA_Y >= 0
185
+#if defined(DIGIPOTS_I2C_SDA_Y) &&  DIGIPOTS_I2C_SDA_Y >= 0
135 186
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Y, __LINE__ )
136 187
 #endif
137
-#if defined(DIGIPOTS_I2C_SDA_Z) && DIGIPOTS_I2C_SDA_Z >= 0
188
+#if defined(DIGIPOTS_I2C_SDA_Z) &&  DIGIPOTS_I2C_SDA_Z >= 0
138 189
   REPORT_NAME_DIGITAL(DIGIPOTS_I2C_SDA_Z, __LINE__ )
139 190
 #endif
140 191
 #if PIN_EXISTS(DIGIPOTSS)
141 192
   REPORT_NAME_DIGITAL(DIGIPOTSS_PIN, __LINE__ )
142 193
 #endif
143
-#if defined(DOGLCD_A0) && DOGLCD_A0 >= 0
194
+#if defined(DOGLCD_A0) &&  DOGLCD_A0 >= 0
144 195
   REPORT_NAME_DIGITAL(DOGLCD_A0, __LINE__ )
145 196
 #endif
146
-#if defined(DOGLCD_CS) && DOGLCD_CS >= 0
197
+#if defined(DOGLCD_CS) &&  DOGLCD_CS >= 0
147 198
   REPORT_NAME_DIGITAL(DOGLCD_CS, __LINE__ )
148 199
 #endif
149
-#if defined(DOGLCD_MOSI) && DOGLCD_MOSI >= 0
200
+#if defined(DOGLCD_MOSI) &&  DOGLCD_MOSI >= 0
150 201
   REPORT_NAME_DIGITAL(DOGLCD_MOSI, __LINE__ )
151 202
 #endif
152
-#if defined(DOGLCD_SCK) && DOGLCD_SCK >= 0
203
+#if defined(DOGLCD_SCK) &&  DOGLCD_SCK >= 0
153 204
   REPORT_NAME_DIGITAL(DOGLCD_SCK, __LINE__ )
154 205
 #endif
206
+#if PIN_EXISTS(E_MUX0)
207
+  REPORT_NAME_DIGITAL(E_MUX0_PIN, __LINE__ )
208
+#endif
209
+#if PIN_EXISTS(E_MUX1)
210
+  REPORT_NAME_DIGITAL(E_MUX1_PIN, __LINE__ )
211
+#endif
212
+#if PIN_EXISTS(E_MUX2)
213
+  REPORT_NAME_DIGITAL(E_MUX2_PIN, __LINE__ )
214
+#endif
215
+#if PIN_EXISTS(E_STOP)
216
+  REPORT_NAME_DIGITAL(E_STOP_PIN, __LINE__ )
217
+#endif
155 218
 #if PIN_EXISTS(E0_ATT)
156 219
   REPORT_NAME_DIGITAL(E0_ATT_PIN, __LINE__ )
157 220
 #endif
158
-#if PIN_EXISTS(E0_AUTO_FAN)
159
-  REPORT_NAME_DIGITAL(E0_AUTO_FAN_PIN, __LINE__ )
160
-#endif
161 221
 #if PIN_EXISTS(E0_CS)
162 222
   REPORT_NAME_DIGITAL(E0_CS_PIN, __LINE__ )
163 223
 #endif
@@ -176,9 +236,6 @@
176 236
 #if PIN_EXISTS(E0_STEP)
177 237
   REPORT_NAME_DIGITAL(E0_STEP_PIN, __LINE__ )
178 238
 #endif
179
-#if PIN_EXISTS(E1_AUTO_FAN)
180
-  REPORT_NAME_DIGITAL(E1_AUTO_FAN_PIN, __LINE__ )
181
-#endif
182 239
 #if PIN_EXISTS(E1_CS)
183 240
   REPORT_NAME_DIGITAL(E1_CS_PIN, __LINE__ )
184 241
 #endif
@@ -197,8 +254,8 @@
197 254
 #if PIN_EXISTS(E1_STEP)
198 255
   REPORT_NAME_DIGITAL(E1_STEP_PIN, __LINE__ )
199 256
 #endif
200
-#if PIN_EXISTS(E2_AUTO_FAN)
201
-  REPORT_NAME_DIGITAL(E2_AUTO_FAN_PIN, __LINE__ )
257
+#if PIN_EXISTS(E2_CS)
258
+  REPORT_NAME_DIGITAL(E2_CS_PIN, __LINE__ )
202 259
 #endif
203 260
 #if PIN_EXISTS(E2_DIR)
204 261
   REPORT_NAME_DIGITAL(E2_DIR_PIN, __LINE__ )
@@ -209,8 +266,8 @@
209 266
 #if PIN_EXISTS(E2_STEP)
210 267
   REPORT_NAME_DIGITAL(E2_STEP_PIN, __LINE__ )
211 268
 #endif
212
-#if PIN_EXISTS(E3_AUTO_FAN)
213
-  REPORT_NAME_DIGITAL(E3_AUTO_FAN_PIN, __LINE__ )
269
+#if PIN_EXISTS(E3_CS)
270
+  REPORT_NAME_DIGITAL(E3_CS_PIN, __LINE__ )
214 271
 #endif
215 272
 #if PIN_EXISTS(E3_DIR)
216 273
   REPORT_NAME_DIGITAL(E3_DIR_PIN, __LINE__ )
@@ -218,12 +275,18 @@
218 275
 #if PIN_EXISTS(E3_ENABLE)
219 276
   REPORT_NAME_DIGITAL(E3_ENABLE_PIN, __LINE__ )
220 277
 #endif
278
+#if PIN_EXISTS(E3_MS1)
279
+  REPORT_NAME_DIGITAL(E3_MS1_PIN, __LINE__ )
280
+#endif
281
+#if PIN_EXISTS(E3_MS2)
282
+  REPORT_NAME_DIGITAL(E3_MS2_PIN, __LINE__ )
283
+#endif
284
+#if PIN_EXISTS(E3_MS3)
285
+  REPORT_NAME_DIGITAL(E3_MS3_PIN, __LINE__ )
286
+#endif
221 287
 #if PIN_EXISTS(E3_STEP)
222 288
   REPORT_NAME_DIGITAL(E3_STEP_PIN, __LINE__ )
223 289
 #endif
224
-#if PIN_EXISTS(E4_AUTO_FAN)
225
-  REPORT_NAME_DIGITAL(E4_AUTO_FAN_PIN, __LINE__ )
226
-#endif
227 290
 #if PIN_EXISTS(E4_DIR)
228 291
   REPORT_NAME_DIGITAL(E4_DIR_PIN, __LINE__ )
229 292
 #endif
@@ -233,86 +296,83 @@
233 296
 #if PIN_EXISTS(E4_STEP)
234 297
   REPORT_NAME_DIGITAL(E4_STEP_PIN, __LINE__ )
235 298
 #endif
236
-#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 < NUM_ANALOG_INPUTS
237
-  REPORT_NAME_ANALOG(EXT_AUX_A0, __LINE__ )
299
+#if defined(ENET_CRS) &&  ENET_CRS >= 0
300
+  REPORT_NAME_DIGITAL(ENET_CRS, __LINE__ )
238 301
 #endif
239
-#if defined(EXT_AUX_A0) && EXT_AUX_A0 >= 0 && EXT_AUX_A0 >= NUM_ANALOG_INPUTS
240
-  REPORT_NAME_DIGITAL(EXT_AUX_A0, __LINE__ )
302
+#if defined(ENET_MDIO) &&  ENET_MDIO >= 0
303
+  REPORT_NAME_DIGITAL(ENET_MDIO, __LINE__ )
241 304
 #endif
242
-#if defined(EXT_AUX_A0_IO) && EXT_AUX_A0_IO >= 0
243
-  REPORT_NAME_DIGITAL(EXT_AUX_A0_IO, __LINE__ )
305
+#if defined(ENET_MOC) &&  ENET_MOC >= 0
306
+  REPORT_NAME_DIGITAL(ENET_MOC, __LINE__ )
244 307
 #endif
245
-#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 < NUM_ANALOG_INPUTS
246
-  REPORT_NAME_ANALOG(EXT_AUX_A1, __LINE__ )
308
+#if defined(ENET_RX_ER) &&  ENET_RX_ER >= 0
309
+  REPORT_NAME_DIGITAL(ENET_RX_ER, __LINE__ )
247 310
 #endif
248
-#if defined(EXT_AUX_A1) && EXT_AUX_A1 >= 0 && EXT_AUX_A1 >= NUM_ANALOG_INPUTS
249
-  REPORT_NAME_DIGITAL(EXT_AUX_A1, __LINE__ )
311
+#if defined(ENET_RXD0) &&  ENET_RXD0 >= 0
312
+  REPORT_NAME_DIGITAL(ENET_RXD0, __LINE__ )
250 313
 #endif
251
-#if defined(EXT_AUX_A1_IO) && EXT_AUX_A1_IO >= 0
252
-  REPORT_NAME_DIGITAL(EXT_AUX_A1_IO, __LINE__ )
314
+#if defined(ENET_RXD1) &&  ENET_RXD1 >= 0
315
+  REPORT_NAME_DIGITAL(ENET_RXD1, __LINE__ )
253 316
 #endif
254
-#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 < NUM_ANALOG_INPUTS
255
-  REPORT_NAME_ANALOG(EXT_AUX_A2, __LINE__ )
317
+#if defined(ENET_TX_EN) &&  ENET_TX_EN >= 0
318
+  REPORT_NAME_DIGITAL(ENET_TX_EN, __LINE__ )
256 319
 #endif
257
-#if defined(EXT_AUX_A2) && EXT_AUX_A2 >= 0 && EXT_AUX_A2 >= NUM_ANALOG_INPUTS
258
-  REPORT_NAME_DIGITAL(EXT_AUX_A2, __LINE__ )
320
+#if defined(ENET_TXD0) &&  ENET_TXD0 >= 0
321
+  REPORT_NAME_DIGITAL(ENET_TXD0, __LINE__ )
259 322
 #endif
260
-#if defined(EXT_AUX_A2_IO) && EXT_AUX_A2_IO >= 0
261
-  REPORT_NAME_DIGITAL(EXT_AUX_A2_IO, __LINE__ )
323
+#if defined(ENET_TXD1) &&  ENET_TXD1 >= 0
324
+  REPORT_NAME_DIGITAL(ENET_TXD1, __LINE__ )
262 325
 #endif
263
-#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 < NUM_ANALOG_INPUTS
264
-  REPORT_NAME_ANALOG(EXT_AUX_A3, __LINE__ )
326
+#if PIN_EXISTS(EXP_VOLTAGE_LEVEL)
327
+  REPORT_NAME_DIGITAL(EXP_VOLTAGE_LEVEL_PIN, __LINE__ )
265 328
 #endif
266
-#if defined(EXT_AUX_A3) && EXT_AUX_A3 >= 0 && EXT_AUX_A3 >= NUM_ANALOG_INPUTS
267
-  REPORT_NAME_DIGITAL(EXT_AUX_A3, __LINE__ )
329
+#if defined(EXT_AUX_A0_IO) &&  EXT_AUX_A0_IO >= 0
330
+  REPORT_NAME_DIGITAL(EXT_AUX_A0_IO, __LINE__ )
268 331
 #endif
269
-#if defined(EXT_AUX_A3_IO) && EXT_AUX_A3_IO >= 0
270
-  REPORT_NAME_DIGITAL(EXT_AUX_A3_IO, __LINE__ )
332
+#if defined(EXT_AUX_A1_IO) &&  EXT_AUX_A1_IO >= 0
333
+  REPORT_NAME_DIGITAL(EXT_AUX_A1_IO, __LINE__ )
271 334
 #endif
272
-#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 < NUM_ANALOG_INPUTS
273
-  REPORT_NAME_ANALOG(EXT_AUX_A4, __LINE__ )
335
+#if defined(EXT_AUX_A2_IO) &&  EXT_AUX_A2_IO >= 0
336
+  REPORT_NAME_DIGITAL(EXT_AUX_A2_IO, __LINE__ )
274 337
 #endif
275
-#if defined(EXT_AUX_A4) && EXT_AUX_A4 >= 0 && EXT_AUX_A4 >= NUM_ANALOG_INPUTS
276
-  REPORT_NAME_DIGITAL(EXT_AUX_A4, __LINE__ )
338
+#if defined(EXT_AUX_A3_IO) &&  EXT_AUX_A3_IO >= 0
339
+  REPORT_NAME_DIGITAL(EXT_AUX_A3_IO, __LINE__ )
277 340
 #endif
278
-#if defined(EXT_AUX_A4_IO) && EXT_AUX_A4_IO >= 0
341
+#if defined(EXT_AUX_A4_IO) &&  EXT_AUX_A4_IO >= 0
279 342
   REPORT_NAME_DIGITAL(EXT_AUX_A4_IO, __LINE__ )
280 343
 #endif
281
-#if defined(EXT_AUX_PWM_D24) && EXT_AUX_PWM_D24 >= 0
344
+#if defined(EXT_AUX_PWM_D24) &&  EXT_AUX_PWM_D24 >= 0
282 345
   REPORT_NAME_DIGITAL(EXT_AUX_PWM_D24, __LINE__ )
283 346
 #endif
284
-#if defined(EXT_AUX_RX1_D2) && EXT_AUX_RX1_D2 >= 0
347
+#if defined(EXT_AUX_RX1_D2) &&  EXT_AUX_RX1_D2 >= 0
285 348
   REPORT_NAME_DIGITAL(EXT_AUX_RX1_D2, __LINE__ )
286 349
 #endif
287
-#if defined(EXT_AUX_SCL_D0) && EXT_AUX_SCL_D0 >= 0
350
+#if defined(EXT_AUX_SCL_D0) &&  EXT_AUX_SCL_D0 >= 0
288 351
   REPORT_NAME_DIGITAL(EXT_AUX_SCL_D0, __LINE__ )
289 352
 #endif
290
-#if defined(EXT_AUX_SDA_D1) && EXT_AUX_SDA_D1 >= 0
353
+#if defined(EXT_AUX_SDA_D1) &&  EXT_AUX_SDA_D1 >= 0
291 354
   REPORT_NAME_DIGITAL(EXT_AUX_SDA_D1, __LINE__ )
292 355
 #endif
293
-#if defined(EXT_AUX_TX1_D3) && EXT_AUX_TX1_D3 >= 0
356
+#if defined(EXT_AUX_TX1_D3) &&  EXT_AUX_TX1_D3 >= 0
294 357
   REPORT_NAME_DIGITAL(EXT_AUX_TX1_D3, __LINE__ )
295 358
 #endif
296
-#if defined(EXTRUDER_0_AUTO_FAN) && EXTRUDER_0_AUTO_FAN >= 0
297
-  REPORT_NAME_DIGITAL(EXTRUDER_0_AUTO_FAN, __LINE__ )
298
-#endif
299
-#if defined(EXTRUDER_1_AUTO_FAN) && EXTRUDER_1_AUTO_FAN >= 0
300
-  REPORT_NAME_DIGITAL(EXTRUDER_1_AUTO_FAN, __LINE__ )
301
-#endif
302 359
 #if PIN_EXISTS(FAN)
303 360
   REPORT_NAME_DIGITAL(FAN_PIN, __LINE__ )
304
-#endif
361
+#endif 
305 362
 #if PIN_EXISTS(FAN1)
306 363
   REPORT_NAME_DIGITAL(FAN1_PIN, __LINE__ )
307 364
 #endif
308 365
 #if PIN_EXISTS(FAN2)
309 366
   REPORT_NAME_DIGITAL(FAN2_PIN, __LINE__ )
310 367
 #endif
368
+#if PIN_EXISTS(FAN3)
369
+  REPORT_NAME_DIGITAL(FAN3_PIN, __LINE__ )
370
+#endif
311 371
 #if PIN_EXISTS(FIL_RUNOUT)
312 372
   REPORT_NAME_DIGITAL(FIL_RUNOUT_PIN, __LINE__ )
313 373
 #endif
314
-#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS
315
-  REPORT_NAME_ANALOG(FILWIDTH_PIN, __LINE__ )
374
+#if defined(GEN7_VERSION) &&  GEN7_VERSION >= 0
375
+  REPORT_NAME_DIGITAL(GEN7_VERSION, __LINE__ )
316 376
 #endif
317 377
 #if PIN_EXISTS(HEATER_0)
318 378
   REPORT_NAME_DIGITAL(HEATER_0_PIN, __LINE__ )
@@ -344,6 +404,9 @@
344 404
 #if PIN_EXISTS(HOME)
345 405
   REPORT_NAME_DIGITAL(HOME_PIN, __LINE__ )
346 406
 #endif
407
+#if defined(I2C_EEPROM) &&  I2C_EEPROM >= 0
408
+  REPORT_NAME_DIGITAL(I2C_EEPROM, __LINE__ )
409
+#endif
347 410
 #if PIN_EXISTS(I2C_SCL)
348 411
   REPORT_NAME_DIGITAL(I2C_SCL_PIN, __LINE__ )
349 412
 #endif
@@ -356,53 +419,56 @@
356 419
 #if PIN_EXISTS(LCD_BACKLIGHT)
357 420
   REPORT_NAME_DIGITAL(LCD_BACKLIGHT_PIN, __LINE__ )
358 421
 #endif
359
-#if defined(LCD_CONTRAST) && LCD_CONTRAST >= 0
360
-  REPORT_NAME_DIGITAL(LCD_CONTRAST, __LINE__ )
361
-#endif
362
-#if defined(LCD_PINS_D4) && LCD_PINS_D4 >= 0
422
+#if PIN_EXISTS(LCD)
363 423
   REPORT_NAME_DIGITAL(LCD_PINS_D4, __LINE__ )
364 424
 #endif
365
-#if defined(LCD_PINS_D5) && LCD_PINS_D5 >= 0
425
+#if PIN_EXISTS(LCD)
366 426
   REPORT_NAME_DIGITAL(LCD_PINS_D5, __LINE__ )
367 427
 #endif
368
-#if defined(LCD_PINS_D6) && LCD_PINS_D6 >= 0
428
+#if PIN_EXISTS(LCD)
369 429
   REPORT_NAME_DIGITAL(LCD_PINS_D6, __LINE__ )
370 430
 #endif
371
-#if defined(LCD_PINS_D7) && LCD_PINS_D7 >= 0
431
+#if PIN_EXISTS(LCD)
372 432
   REPORT_NAME_DIGITAL(LCD_PINS_D7, __LINE__ )
373 433
 #endif
374
-#if defined(LCD_PINS_ENABLE) && LCD_PINS_ENABLE >= 0
434
+#if PIN_EXISTS(LCD)
375 435
   REPORT_NAME_DIGITAL(LCD_PINS_ENABLE, __LINE__ )
376 436
 #endif
377
-#if defined(LCD_PINS_RS) && LCD_PINS_RS >= 0
437
+#if PIN_EXISTS(LCD)
378 438
   REPORT_NAME_DIGITAL(LCD_PINS_RS, __LINE__ )
379 439
 #endif
380
-#if defined(LCD_SDSS) && LCD_SDSS >= 0
440
+#if defined(LCD_SDSS) &&  LCD_SDSS >= 0
381 441
   REPORT_NAME_DIGITAL(LCD_SDSS, __LINE__ )
382 442
 #endif
443
+#if PIN_EXISTS(LED_GREEN)
444
+  REPORT_NAME_DIGITAL(LED_GREEN_PIN, __LINE__ )
445
+#endif
383 446
 #if PIN_EXISTS(LED)
384 447
   REPORT_NAME_DIGITAL(LED_PIN, __LINE__ )
385 448
 #endif
386
-#if PIN_EXISTS(MAIN_VOLTAGE_MEASURE) && MAIN_VOLTAGE_MEASURE_PIN < NUM_ANALOG_INPUTS
387
-  REPORT_NAME_ANALOG(MAIN_VOLTAGE_MEASURE_PIN, __LINE__ )
449
+#if PIN_EXISTS(LED_RED)
450
+  REPORT_NAME_DIGITAL(LED_RED_PIN, __LINE__ )
388 451
 #endif
389
-#if defined(MAX6675_SS) && MAX6675_SS >= 0
390
-  REPORT_NAME_DIGITAL(MAX6675_SS, __LINE__ )
452
+#if PIN_EXISTS(MAX)
453
+  REPORT_NAME_DIGITAL(MAX_PIN, __LINE__ )
391 454
 #endif
392
-#if PIN_EXISTS(MISO)
393
-  REPORT_NAME_DIGITAL(MISO_PIN, __LINE__ )
455
+#if PIN_EXISTS(MAX6675_DO)
456
+  REPORT_NAME_DIGITAL(MAX6675_DO_PIN, __LINE__ )
457
+#endif
458
+#if PIN_EXISTS(MAX6675_SCK)
459
+  REPORT_NAME_DIGITAL(MAX6675_SCK_PIN, __LINE__ )
394 460
 #endif
395
-#if PIN_EXISTS(MOSFET_A)
396
-  REPORT_NAME_DIGITAL(MOSFET_A_PIN, __LINE__ )
461
+#if defined(MAX6675_SS) &&  MAX6675_SS >= 0
462
+  REPORT_NAME_DIGITAL(MAX6675_SS, __LINE__ )
397 463
 #endif
398
-#if PIN_EXISTS(MOSFET_B)
399
-  REPORT_NAME_DIGITAL(MOSFET_B_PIN, __LINE__ )
464
+#if defined(MISO) &&  MISO >= 0
465
+  REPORT_NAME_DIGITAL(MISO, __LINE__ )
400 466
 #endif
401
-#if PIN_EXISTS(MOSFET_C)
402
-  REPORT_NAME_DIGITAL(MOSFET_C_PIN, __LINE__ )
467
+#if PIN_EXISTS(MISO)
468
+  REPORT_NAME_DIGITAL(MISO_PIN, __LINE__ )
403 469
 #endif
404
-#if PIN_EXISTS(MOSFET_D)
405
-  REPORT_NAME_DIGITAL(MOSFET_D_PIN, __LINE__ )
470
+#if defined(MOSI) &&  MOSI >= 0
471
+  REPORT_NAME_DIGITAL(MOSI, __LINE__ )
406 472
 #endif
407 473
 #if PIN_EXISTS(MOSI)
408 474
   REPORT_NAME_DIGITAL(MOSI_PIN, __LINE__ )
@@ -416,6 +482,12 @@
416 482
 #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
417 483
   REPORT_NAME_DIGITAL(MOTOR_CURRENT_PWM_Z_PIN, __LINE__ )
418 484
 #endif
485
+#if PIN_EXISTS(MOTOR_FAULT)
486
+  REPORT_NAME_DIGITAL(MOTOR_FAULT_PIN, __LINE__ )
487
+#endif
488
+#if PIN_EXISTS(NUM_DIGITAL)
489
+  REPORT_NAME_DIGITAL(NUM_DIGITAL_PINS, __LINE__ )
490
+#endif
419 491
 #if PIN_EXISTS(ORIG_E0_AUTO_FAN)
420 492
   REPORT_NAME_DIGITAL(ORIG_E0_AUTO_FAN_PIN, __LINE__ )
421 493
 #endif
@@ -428,9 +500,6 @@
428 500
 #if PIN_EXISTS(ORIG_E3_AUTO_FAN)
429 501
   REPORT_NAME_DIGITAL(ORIG_E3_AUTO_FAN_PIN, __LINE__ )
430 502
 #endif
431
-#if PIN_EXISTS(ORIG_E4_AUTO_FAN)
432
-  REPORT_NAME_DIGITAL(ORIG_E4_AUTO_FAN_PIN, __LINE__ )
433
-#endif
434 503
 #if PIN_EXISTS(PHOTOGRAPH)
435 504
   REPORT_NAME_DIGITAL(PHOTOGRAPH_PIN, __LINE__ )
436 505
 #endif
@@ -443,26 +512,8 @@
443 512
 #if PIN_EXISTS(PWM_2)
444 513
   REPORT_NAME_DIGITAL(PWM_2_PIN, __LINE__ )
445 514
 #endif
446
-#if PIN_EXISTS(RAMPS_D10)
447
-  REPORT_NAME_DIGITAL(RAMPS_D10_PIN, __LINE__ )
448
-#endif
449
-#if PIN_EXISTS(RAMPS_D8)
450
-  REPORT_NAME_DIGITAL(RAMPS_D8_PIN, __LINE__ )
451
-#endif
452
-#if PIN_EXISTS(RAMPS_D9)
453
-  REPORT_NAME_DIGITAL(RAMPS_D9_PIN, __LINE__ )
454
-#endif
455
-#if PIN_EXISTS(RGB_LED_R)
456
-  REPORT_NAME_DIGITAL(RGB_LED_R_PIN, __LINE__ )
457
-#endif
458
-#if PIN_EXISTS(RGB_LED_G)
459
-  REPORT_NAME_DIGITAL(RGB_LED_G_PIN, __LINE__ )
460
-#endif
461
-#if PIN_EXISTS(RGB_LED_B)
462
-  REPORT_NAME_DIGITAL(RGB_LED_B_PIN, __LINE__ )
463
-#endif
464
-#if PIN_EXISTS(RGB_LED_W)
465
-  REPORT_NAME_DIGITAL(RGB_LED_W_PIN, __LINE__ )
515
+#if defined(REF_CLK) &&  REF_CLK >= 0
516
+  REPORT_NAME_DIGITAL(REF_CLK, __LINE__ )
466 517
 #endif
467 518
 #if PIN_EXISTS(RX_ENABLE)
468 519
   REPORT_NAME_DIGITAL(RX_ENABLE_PIN, __LINE__ )
@@ -470,24 +521,24 @@
470 521
 #if PIN_EXISTS(SAFETY_TRIGGERED)
471 522
   REPORT_NAME_DIGITAL(SAFETY_TRIGGERED_PIN, __LINE__ )
472 523
 #endif
524
+#if defined(SCK) &&  SCK >= 0
525
+  REPORT_NAME_DIGITAL(SCK, __LINE__ )
526
+#endif
473 527
 #if PIN_EXISTS(SCK)
474 528
   REPORT_NAME_DIGITAL(SCK_PIN, __LINE__ )
475 529
 #endif
476
-#if defined(SCL) && SCL >= 0
477
-  REPORT_NAME_DIGITAL(SCL, __LINE__ )
478
-#endif
479 530
 #if PIN_EXISTS(SD_DETECT)
480 531
   REPORT_NAME_DIGITAL(SD_DETECT_PIN, __LINE__ )
481 532
 #endif
482
-#if defined(SDA) && SDA >= 0
483
-  REPORT_NAME_DIGITAL(SDA, __LINE__ )
484
-#endif
485
-#if defined(SDPOWER) && SDPOWER >= 0
533
+#if defined(SDPOWER) &&  SDPOWER >= 0
486 534
   REPORT_NAME_DIGITAL(SDPOWER, __LINE__ )
487 535
 #endif
488
-#if defined(SDSS) && SDSS >= 0
536
+#if defined(SDSS) &&  SDSS >= 0
489 537
   REPORT_NAME_DIGITAL(SDSS, __LINE__ )
490 538
 #endif
539
+#if defined(SERVO0) &&  SERVO0 >= 0
540
+  REPORT_NAME_DIGITAL(SERVO0, __LINE__ )
541
+#endif
491 542
 #if PIN_EXISTS(SERVO0)
492 543
   REPORT_NAME_DIGITAL(SERVO0_PIN, __LINE__ )
493 544
 #endif
@@ -500,45 +551,54 @@
500 551
 #if PIN_EXISTS(SERVO3)
501 552
   REPORT_NAME_DIGITAL(SERVO3_PIN, __LINE__ )
502 553
 #endif
503
-#if defined(SHIFT_CLK) && SHIFT_CLK >= 0
554
+#if defined(SHIFT_CLK) &&  SHIFT_CLK >= 0
504 555
   REPORT_NAME_DIGITAL(SHIFT_CLK, __LINE__ )
505 556
 #endif
506
-#if defined(SHIFT_EN) && SHIFT_EN >= 0
557
+#if defined(SHIFT_EN) &&  SHIFT_EN >= 0
507 558
   REPORT_NAME_DIGITAL(SHIFT_EN, __LINE__ )
508 559
 #endif
509
-#if defined(SHIFT_LD) && SHIFT_LD >= 0
560
+#if defined(SHIFT_LD) &&  SHIFT_LD >= 0
510 561
   REPORT_NAME_DIGITAL(SHIFT_LD, __LINE__ )
511 562
 #endif
512
-#if defined(SHIFT_OUT) && SHIFT_OUT >= 0
563
+#if defined(SHIFT_OUT) &&  SHIFT_OUT >= 0
513 564
   REPORT_NAME_DIGITAL(SHIFT_OUT, __LINE__ )
514 565
 #endif
515
-#if PIN_EXISTS(SLED)
516
-  REPORT_NAME_DIGITAL(SLED_PIN, __LINE__ )
517
-#endif
518 566
 #if PIN_EXISTS(SLEEP_WAKE)
519 567
   REPORT_NAME_DIGITAL(SLEEP_WAKE_PIN, __LINE__ )
520 568
 #endif
521
-#if PIN_EXISTS(SOL0)
522
-  REPORT_NAME_DIGITAL(SOL0_PIN, __LINE__ )
523
-#endif
524 569
 #if PIN_EXISTS(SOL1)
525 570
   REPORT_NAME_DIGITAL(SOL1_PIN, __LINE__ )
526 571
 #endif
527 572
 #if PIN_EXISTS(SOL2)
528 573
   REPORT_NAME_DIGITAL(SOL2_PIN, __LINE__ )
529 574
 #endif
530
-#if PIN_EXISTS(SOL3)
531
-  REPORT_NAME_DIGITAL(SOL3_PIN, __LINE__ )
575
+#if defined(SPARE_IO) &&  SPARE_IO >= 0
576
+  REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ )
532 577
 #endif
533
-#if PIN_EXISTS(SOL4)
534
-  REPORT_NAME_DIGITAL(SOL4_PIN, __LINE__ )
578
+#if defined(SPI_CHAN_DAC) &&  SPI_CHAN_DAC >= 0
579
+  REPORT_NAME_DIGITAL(SPI_CHAN_DAC, __LINE__ )
535 580
 #endif
536
-#if defined(SPARE_IO) && SPARE_IO >= 0
537
-  REPORT_NAME_DIGITAL(SPARE_IO, __LINE__ )
581
+#if defined(SPI_CHAN_EEPROM1) &&  SPI_CHAN_EEPROM1 >= 0
582
+  REPORT_NAME_DIGITAL(SPI_CHAN_EEPROM1, __LINE__ )
583
+#endif
584
+#if defined(SPI_EEPROM) &&  SPI_EEPROM >= 0
585
+  REPORT_NAME_DIGITAL(SPI_EEPROM, __LINE__ )
586
+#endif
587
+#if defined(SPI_EEPROM1_CS) &&  SPI_EEPROM1_CS >= 0
588
+  REPORT_NAME_DIGITAL(SPI_EEPROM1_CS, __LINE__ )
589
+#endif
590
+#if defined(SPI_EEPROM2_CS) &&  SPI_EEPROM2_CS >= 0
591
+  REPORT_NAME_DIGITAL(SPI_EEPROM2_CS, __LINE__ )
592
+#endif
593
+#if defined(SPI_FLASH_CS) &&  SPI_FLASH_CS >= 0
594
+  REPORT_NAME_DIGITAL(SPI_FLASH_CS, __LINE__ )
538 595
 #endif
539 596
 #if PIN_EXISTS(SPINDLE_DIR)
540 597
   REPORT_NAME_DIGITAL(SPINDLE_DIR_PIN, __LINE__ )
541 598
 #endif
599
+#if PIN_EXISTS(SPINDLE_ENABLE)
600
+  REPORT_NAME_DIGITAL(SPINDLE_ENABLE_PIN, __LINE__ )
601
+#endif
542 602
 #if PIN_EXISTS(SPINDLE_LASER_ENABLE)
543 603
   REPORT_NAME_DIGITAL(SPINDLE_LASER_ENABLE_PIN, __LINE__ )
544 604
 #endif
@@ -554,12 +614,12 @@
554 614
 #if PIN_EXISTS(SR_STROBE)
555 615
   REPORT_NAME_DIGITAL(SR_STROBE_PIN, __LINE__ )
556 616
 #endif
557
-#if PIN_EXISTS(SS)
558
-  REPORT_NAME_DIGITAL(SS_PIN, __LINE__ )
559
-#endif
560 617
 #if PIN_EXISTS(STAT_LED_BLUE)
561 618
   REPORT_NAME_DIGITAL(STAT_LED_BLUE_PIN, __LINE__ )
562 619
 #endif
620
+#if defined(STAT_LED_RED_LED) &&  STAT_LED_RED_LED >= 0
621
+  REPORT_NAME_DIGITAL(STAT_LED_RED_LED, __LINE__ )
622
+#endif
563 623
 #if PIN_EXISTS(STAT_LED_RED)
564 624
   REPORT_NAME_DIGITAL(STAT_LED_RED_PIN, __LINE__ )
565 625
 #endif
@@ -569,47 +629,11 @@
569 629
 #if PIN_EXISTS(SUICIDE)
570 630
   REPORT_NAME_DIGITAL(SUICIDE_PIN, __LINE__ )
571 631
 #endif
572
-#if defined(TC1) && TC1 >= 0 && TC1 < NUM_ANALOG_INPUTS
573
-  REPORT_NAME_ANALOG(TC1, __LINE__ )
574
-#endif
575
-#if defined(TC2) && TC2 >= 0 && TC2 < NUM_ANALOG_INPUTS
576
-  REPORT_NAME_ANALOG(TC2, __LINE__ )
577
-#endif
578
-#if PIN_EXISTS(FILWIDTH) && FILWIDTH_PIN < NUM_ANALOG_INPUTS
579
-  REPORT_NAME_ANALOG(FILWIDTH_PIN, __LINE__ )
580
-#endif
581
-#if PIN_EXISTS(TEMP_0) && TEMP_0_PIN < NUM_ANALOG_INPUTS
582
-  REPORT_NAME_ANALOG(TEMP_0_PIN, __LINE__ )
583
-#endif
584
-#if PIN_EXISTS(TEMP_1) && TEMP_1_PIN < NUM_ANALOG_INPUTS
585
-  REPORT_NAME_ANALOG(TEMP_1_PIN, __LINE__ )
586
-#endif
587
-#if PIN_EXISTS(TEMP_2) && TEMP_2_PIN < NUM_ANALOG_INPUTS
588
-  REPORT_NAME_ANALOG(TEMP_2_PIN, __LINE__ )
589
-#endif
590
-#if PIN_EXISTS(TEMP_3) && TEMP_3_PIN < NUM_ANALOG_INPUTS
591
-  REPORT_NAME_ANALOG(TEMP_3_PIN, __LINE__ )
632
+#if defined(THERMO_CS1) &&  THERMO_CS1 >= 0
633
+  REPORT_NAME_DIGITAL(THERMO_CS1, __LINE__ )
592 634
 #endif
593
-#if PIN_EXISTS(TEMP_4) && TEMP_4_PIN < NUM_ANALOG_INPUTS
594
-  REPORT_NAME_ANALOG(TEMP_4_PIN, __LINE__ )
595
-#endif
596
-#if PIN_EXISTS(TEMP_5) && TEMP_5_PIN < NUM_ANALOG_INPUTS
597
-  REPORT_NAME_ANALOG(TEMP_5_PIN, __LINE__ )
598
-#endif
599
-#if PIN_EXISTS(TEMP_6) && TEMP_6_PIN < NUM_ANALOG_INPUTS
600
-  REPORT_NAME_ANALOG(TEMP_6_PIN, __LINE__ )
601
-#endif
602
-#if PIN_EXISTS(TEMP_7) && TEMP_7_PIN < NUM_ANALOG_INPUTS
603
-  REPORT_NAME_ANALOG(TEMP_7_PIN, __LINE__ )
604
-#endif
605
-#if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS
606
-  REPORT_NAME_ANALOG(TEMP_BED_PIN, __LINE__ )
607
-#endif
608
-#if PIN_EXISTS(TEMP_CHAMBER) && TEMP_CHAMBER_PIN < NUM_ANALOG_INPUTS
609
-  REPORT_NAME_ANALOG(TEMP_CHAMBER_PIN, __LINE__ )
610
-#endif
611
-#if PIN_EXISTS(TEMP_X) && TEMP_X_PIN < NUM_ANALOG_INPUTS
612
-  REPORT_NAME_ANALOG(TEMP_X_PIN, __LINE__ )
635
+#if defined(THERMO_CS2) &&  THERMO_CS2 >= 0
636
+  REPORT_NAME_DIGITAL(THERMO_CS2, __LINE__ )
613 637
 #endif
614 638
 #if PIN_EXISTS(THERMO_DO)
615 639
   REPORT_NAME_DIGITAL(THERMO_DO_PIN, __LINE__ )
@@ -617,18 +641,42 @@
617 641
 #if PIN_EXISTS(THERMO_SCK)
618 642
   REPORT_NAME_DIGITAL(THERMO_SCK_PIN, __LINE__ )
619 643
 #endif
644
+#if defined(TLC_BLANK_BIT) &&  TLC_BLANK_BIT >= 0
645
+  REPORT_NAME_DIGITAL(TLC_BLANK_BIT, __LINE__ )
646
+#endif
620 647
 #if PIN_EXISTS(TLC_BLANK)
621 648
   REPORT_NAME_DIGITAL(TLC_BLANK_PIN, __LINE__ )
622 649
 #endif
650
+#if defined(TLC_BLANK_PORT) &&  TLC_BLANK_PORT >= 0
651
+  REPORT_NAME_DIGITAL(TLC_BLANK_PORT, __LINE__ )
652
+#endif
653
+#if defined(TLC_CLOCK_BIT) &&  TLC_CLOCK_BIT >= 0
654
+  REPORT_NAME_DIGITAL(TLC_CLOCK_BIT, __LINE__ )
655
+#endif
623 656
 #if PIN_EXISTS(TLC_CLOCK)
624 657
   REPORT_NAME_DIGITAL(TLC_CLOCK_PIN, __LINE__ )
625 658
 #endif
659
+#if defined(TLC_CLOCK_PORT) &&  TLC_CLOCK_PORT >= 0
660
+  REPORT_NAME_DIGITAL(TLC_CLOCK_PORT, __LINE__ )
661
+#endif
662
+#if defined(TLC_DATA_BIT) &&  TLC_DATA_BIT >= 0
663
+  REPORT_NAME_DIGITAL(TLC_DATA_BIT, __LINE__ )
664
+#endif
626 665
 #if PIN_EXISTS(TLC_DATA)
627 666
   REPORT_NAME_DIGITAL(TLC_DATA_PIN, __LINE__ )
628 667
 #endif
668
+#if defined(TLC_DATA_PORT) &&  TLC_DATA_PORT >= 0
669
+  REPORT_NAME_DIGITAL(TLC_DATA_PORT, __LINE__ )
670
+#endif
671
+#if defined(TLC_XLAT_BIT) &&  TLC_XLAT_BIT >= 0
672
+  REPORT_NAME_DIGITAL(TLC_XLAT_BIT, __LINE__ )
673
+#endif
629 674
 #if PIN_EXISTS(TLC_XLAT)
630 675
   REPORT_NAME_DIGITAL(TLC_XLAT_PIN, __LINE__ )
631 676
 #endif
677
+#if defined(TLC_XLAT_PORT) &&  TLC_XLAT_PORT >= 0
678
+  REPORT_NAME_DIGITAL(TLC_XLAT_PORT, __LINE__ )
679
+#endif
632 680
 #if PIN_EXISTS(TOOL_0)
633 681
   REPORT_NAME_DIGITAL(TOOL_0_PIN, __LINE__ )
634 682
 #endif
@@ -659,13 +707,13 @@
659 707
 #if PIN_EXISTS(TX_ENABLE)
660 708
   REPORT_NAME_DIGITAL(TX_ENABLE_PIN, __LINE__ )
661 709
 #endif
662
-#if defined(UI1) && UI1 >= 0
710
+#if defined(UI1) &&  UI1 >= 0
663 711
   REPORT_NAME_DIGITAL(UI1, __LINE__ )
664 712
 #endif
665
-#if defined(UI2) && UI2 >= 0
713
+#if defined(UI2) &&  UI2 >= 0
666 714
   REPORT_NAME_DIGITAL(UI2, __LINE__ )
667 715
 #endif
668
-#if defined(UNUSED_PWM) && UNUSED_PWM >= 0
716
+#if defined(UNUSED_PWM) &&  UNUSED_PWM >= 0
669 717
   REPORT_NAME_DIGITAL(UNUSED_PWM, __LINE__ )
670 718
 #endif
671 719
 #if PIN_EXISTS(X_ATT)
@@ -698,15 +746,6 @@
698 746
 #if PIN_EXISTS(X_STOP)
699 747
   REPORT_NAME_DIGITAL(X_STOP_PIN, __LINE__ )
700 748
 #endif
701
-#if PIN_EXISTS(X2_DIR)
702
-  REPORT_NAME_DIGITAL(X2_DIR_PIN, __LINE__ )
703
-#endif
704
-#if PIN_EXISTS(X2_ENABLE)
705
-  REPORT_NAME_DIGITAL(X2_ENABLE_PIN, __LINE__ )
706
-#endif
707
-#if PIN_EXISTS(X2_STEP)
708
-  REPORT_NAME_DIGITAL(X2_STEP_PIN, __LINE__ )
709
-#endif
710 749
 #if PIN_EXISTS(Y_ATT)
711 750
   REPORT_NAME_DIGITAL(Y_ATT_PIN, __LINE__ )
712 751
 #endif
@@ -737,15 +776,6 @@
737 776
 #if PIN_EXISTS(Y_STOP)
738 777
   REPORT_NAME_DIGITAL(Y_STOP_PIN, __LINE__ )
739 778
 #endif
740
-#if PIN_EXISTS(Y2_DIR)
741
-  REPORT_NAME_DIGITAL(Y2_DIR_PIN, __LINE__ )
742
-#endif
743
-#if PIN_EXISTS(Y2_ENABLE)
744
-  REPORT_NAME_DIGITAL(Y2_ENABLE_PIN, __LINE__ )
745
-#endif
746
-#if PIN_EXISTS(Y2_STEP)
747
-  REPORT_NAME_DIGITAL(Y2_STEP_PIN, __LINE__ )
748
-#endif
749 779
 #if PIN_EXISTS(Z_ATT)
750 780
   REPORT_NAME_DIGITAL(Z_ATT_PIN, __LINE__ )
751 781
 #endif
@@ -773,19 +803,39 @@
773 803
 #if PIN_EXISTS(Z_MS2)
774 804
   REPORT_NAME_DIGITAL(Z_MS2_PIN, __LINE__ )
775 805
 #endif
806
+#if defined(Z_probe_pin) &&  Z_probe_pin >= 0
807
+  REPORT_NAME_DIGITAL(Z_probe_pin, __LINE__ )
808
+#endif
776 809
 #if PIN_EXISTS(Z_STEP)
777 810
   REPORT_NAME_DIGITAL(Z_STEP_PIN, __LINE__ )
778 811
 #endif
779 812
 #if PIN_EXISTS(Z_STOP)
780 813
   REPORT_NAME_DIGITAL(Z_STOP_PIN, __LINE__ )
781 814
 #endif
815
+#if PIN_EXISTS(Z2_CS)
816
+  REPORT_NAME_DIGITAL(Z2_CS_PIN, __LINE__ )
817
+#endif
782 818
 #if PIN_EXISTS(Z2_DIR)
783 819
   REPORT_NAME_DIGITAL(Z2_DIR_PIN, __LINE__ )
784 820
 #endif
785 821
 #if PIN_EXISTS(Z2_ENABLE)
786 822
   REPORT_NAME_DIGITAL(Z2_ENABLE_PIN, __LINE__ )
787 823
 #endif
824
+#if PIN_EXISTS(Z2_MS1)
825
+  REPORT_NAME_DIGITAL(Z2_MS1_PIN, __LINE__ )
826
+#endif
827
+#if PIN_EXISTS(Z2_MS2)
828
+  REPORT_NAME_DIGITAL(Z2_MS2_PIN, __LINE__ )
829
+#endif
830
+#if PIN_EXISTS(Z2_MS3)
831
+  REPORT_NAME_DIGITAL(Z2_MS3_PIN, __LINE__ )
832
+#endif
788 833
 #if PIN_EXISTS(Z2_STEP)
789 834
   REPORT_NAME_DIGITAL(Z2_STEP_PIN, __LINE__ )
790 835
 #endif
791
-
836
+#if PIN_EXISTS(ZRIB_V20_D6)
837
+  REPORT_NAME_DIGITAL(ZRIB_V20_D6_PIN, __LINE__ )
838
+#endif
839
+#if PIN_EXISTS(ZRIB_V20_D9)
840
+  REPORT_NAME_DIGITAL(ZRIB_V20_D9_PIN, __LINE__ )
841
+#endif

+ 47
- 7
Marlin/pins_RAMPS_RE_ARM.h View File

@@ -194,11 +194,9 @@
194 194
 //
195 195
 #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE)
196 196
   #if !defined(NUM_SERVOS) || NUM_SERVOS == 1 // must use servo connector
197
-    #undef  SERVO0
198 197
     #undef  SERVO1
199 198
     #undef  SERVO2
200 199
     #undef  SERVO3
201
-    #define SERVO0    4
202 200
     #define SPINDLE_LASER_ENABLE_PIN  6  // Pin should have a pullup/pulldown!
203 201
     #define SPINDLE_LASER_PWM_PIN     4  // MUST BE HARDWARE PWM
204 202
     #define SPINDLE_DIR_PIN           5
@@ -214,16 +212,20 @@
214 212
 /**
215 213
  * LCD / Controller
216 214
  *
215
+ * All controllers can use J3 and J5 on the Re-ARM board.  Custom cabling will be required.
216
+ */
217
+ 
218
+/** 
219
+ * Smart LCD adapter 
220
+ *
217 221
  * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as
218 222
  * REPRAP_DISCOUNT_SMART_CONTROLLER.  It can't be used for controllers that use
219 223
  * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable
220 224
  * is needed to pick up 5V for the EXP1 connection.
221 225
  *
222
- * All controllers can use J3 and J5 on the Re-ARM board.  Custom cabling will be required.
223
- *
224
- * SD card on the LCD is not yet supported.
225
- *
226
- * SD card on the LCD uses the same SPI signals as the LCD.
226
+ * SD card on the LCD uses the same SPI signals as the LCD. This results in garbage/lines
227
+ * on the LCD display during accesses of the SD card. The menus/code has been arranged so 
228
+ * that the garbage/lines are erased immediately after the SD card accesses are completed.
227 229
  */
228 230
 
229 231
 #if ENABLED(ULTRA_LCD)
@@ -243,6 +245,24 @@
243 245
     //#define SHIFT_EN            41  // J5-4 & AUX-4
244 246
   #endif
245 247
 
248
+  #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && ENABLED(SDSUPPORT)
249
+    #define SDCARD_SORT_ALPHA           // Using SORT feature to keep one directory level in RAM
250
+                                        // When going up/down directory levels the SD card is
251
+                                        // accessed but the garbage/lines are removed when the 
252
+                                        // LCD updates
253
+
254
+    // SD Card Sorting options
255
+    #if ENABLED(SDCARD_SORT_ALPHA)
256
+      #define SDSORT_LIMIT       255    // Maximum number of sorted items (10-256).
257
+      #define FOLDER_SORTING     -1     // -1=above  0=none  1=below
258
+      #define SDSORT_GCODE       false  // Allow turning sorting on/off with LCD and M34 g-code.
259
+      #define SDSORT_USES_RAM    true   // Pre-allocate a static array for faster pre-sorting.
260
+      #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
261
+      #define SDSORT_CACHE_NAMES true   // Keep sorted items in RAM longer for speedy performance. Most expensive option.
262
+      #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
263
+    #endif
264
+  #endif
265
+  
246 266
   #define BTN_EN1             31  // J3-2 & AUX-4
247 267
   #define BTN_EN2             33  // J3-4 & AUX-4
248 268
   #define BTN_ENC             35  // J3-3 & AUX-4
@@ -300,6 +320,26 @@
300 320
 #define ENET_TXD0   78  // J12-11
301 321
 #define ENET_TXD1   79  // J12-12
302 322
 
323
+/**
324
+ *  PWMS
325
+ *
326
+ *  There are 6 PWMS.  Each PWM can be assigned to one of two pins.
327
+ *
328
+ *  SERVO2 does NOT have a PWM assigned to it.
329
+ *
330
+ *  PWM1.1   DIO4    SERVO3_PIN       FIL_RUNOUT_PIN   5V output, PWM
331
+ *  PWM1.1   DIO26   E0_STEP_PIN
332
+ *  PWM1.2   DIO11   SERVO0_PIN
333
+ *  PWM1.2   DIO54   X_STEP_PIN
334
+ *  PWM1.3   DIO6    SERVO1_PIN       J5-1
335
+ *  PWM1.3   DIO60   Y_STEP_PIN
336
+ *  PWM1.4   DIO53   SDSS(SSEL0)      J3-5  AUX-3
337
+ *  PWM1.4   DIO46   Z_STEP_PIN
338
+ *  PWM1.5   DIO3    X_MIN_PIN        10K PULLUP TO 3.3v, 1K SERIES
339
+ *  PWM1.5   DIO9    RAMPS_D9_PIN
340
+ *  PWM1.6   DIO14   Y_MIN_PIN        10K PULLUP TO 3.3v, 1K SERIES
341
+ *  PWM1.6   DIO10   RAMPS_D10_PIN
342
+ */
303 343
 
304 344
 /**
305 345
  *  The following pins are NOT available in a Re-ARM system

+ 102
- 0
Marlin/src/HAL/HAL_AVR/SanityCheck_AVR_8_bit.h View File

@@ -0,0 +1,102 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Test AVR specific configuration values for errors at compile-time.
25
+ */
26
+
27
+/**
28
+ * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
29
+ */
30
+
31
+
32
+/**
33
+ * Digipot requirement
34
+ */
35
+ #if ENABLED(DIGIPOT_MCP4018)
36
+  #if !defined(DIGIPOTS_I2C_SDA_X) || !defined(DIGIPOTS_I2C_SDA_Y) || !defined(DIGIPOTS_I2C_SDA_Z) \
37
+    || !defined(DIGIPOTS_I2C_SDA_E0) || !defined(DIGIPOTS_I2C_SDA_E1)
38
+      #error "DIGIPOT_MCP4018 requires DIGIPOTS_I2C_SDA_* pins to be defined."
39
+  #endif
40
+#endif
41
+
42
+
43
+
44
+/**
45
+ * Sanity checks for Spindle / Laser
46
+ */
47
+
48
+#if ENABLED(SPINDLE_LASER_ENABLE)
49
+  #if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
50
+    #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
51
+  #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR)
52
+    #error "SPINDLE_DIR_PIN not defined."
53
+  #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM)
54
+    #if !(WITHIN(SPINDLE_LASER_PWM_PIN, 2, 13) || WITHIN(SPINDLE_LASER_PWM_PIN, 44, 46))
55
+      #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
56
+    #elif SPINDLE_LASER_POWERUP_DELAY < 1
57
+      #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
58
+    #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
59
+      #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
60
+    #elif !defined(SPINDLE_LASER_PWM_INVERT)
61
+      #error "SPINDLE_LASER_PWM_INVERT missing."
62
+    #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
63
+      #error "SPINDLE_LASER_PWM equation constant(s) missing."
64
+    #elif SPINDLE_LASER_PWM_PIN == 4 || WITHIN(SPINDLE_LASER_PWM_PIN, 11, 13)
65
+      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by a system interrupt."
66
+    #elif PIN_EXISTS(X_MAX) && X_MAX_PIN == SPINDLE_LASER_PWM_PIN
67
+      #error "SPINDLE_LASER_PWM pin is in use by X_MAX endstop."
68
+    #elif PIN_EXISTS(X_MIN) && X_MIN_PIN == SPINDLE_LASER_PWM_PIN
69
+      #error "SPINDLE_LASER_PWM pin is in use by X_MIN endstop."
70
+    #elif PIN_EXISTS(Z_STEP) && Z_STEP_PIN == SPINDLE_LASER_PWM_PIN
71
+      #error "SPINDLE_LASER_PWM pin in use by Z_STEP."
72
+    #elif NUM_SERVOS > 0 && (WITHIN(SPINDLE_LASER_PWM_PIN, 2, 3) || SPINDLE_LASER_PWM_PIN == 5)
73
+      #error "Counter/Timer for SPINDLE_LASER_PWM_PIN is used by the servo system."
74
+    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
75
+      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN."
76
+    #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN
77
+      #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN."
78
+    #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN
79
+      #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN."
80
+    #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN
81
+      #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN."
82
+    #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN
83
+      #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN."
84
+    #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN
85
+      #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN."
86
+    #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN
87
+      #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN."
88
+    #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN
89
+      #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN."
90
+    #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN
91
+      #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN."
92
+    #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN
93
+      #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN."
94
+    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN
95
+      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_XY."
96
+    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_Z_PIN
97
+      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_Z."
98
+    #elif PIN_EXISTS(MOTOR_CURRENT_PWM_E) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_E_PIN
99
+      #error "SPINDLE_LASER_PWM_PIN is used by MOTOR_CURRENT_PWM_E."
100
+    #endif
101
+  #endif
102
+#endif // SPINDLE_LASER_ENABLE

+ 397
- 0
Marlin/src/HAL/HAL_AVR/pinsDebug_AVR_8_bit.h View File

@@ -0,0 +1,397 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * PWM print routines for Atmel 8 bit AVR CPUs
25
+ */
26
+
27
+
28
+#define AVR_ATmega2560_FAMILY_PLUS_70 (MOTHERBOARD == BOARD_BQ_ZUM_MEGA_3D \
29
+|| MOTHERBOARD == BOARD_MIGHTYBOARD_REVE \
30
+|| MOTHERBOARD == BOARD_MINIRAMBO \
31
+|| MOTHERBOARD == BOARD_SCOOVO_X9H)
32
+
33
+#if AVR_AT90USB1286_FAMILY
34
+  // Working with Teensyduino extension so need to re-define some things
35
+  #include "pinsDebug_Teensyduino.h"
36
+  // Can't use the "digitalPinToPort" function from the Teensyduino type IDEs
37
+  // portModeRegister takes a different argument
38
+  #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
39
+  #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
40
+  #define digitalPinToPort_DEBUG(p) digitalPinToPort_Teensy(p)
41
+  #define GET_PINMODE(pin) (*portModeRegister(pin) & digitalPinToBitMask_DEBUG(pin))
42
+#elif AVR_ATmega2560_FAMILY_PLUS_70   // So we can access/display all the pins on boards using more than 70
43
+  #include "pinsDebug_plus_70.h"
44
+  #define digitalPinToTimer_DEBUG(p) digitalPinToTimer_plus_70(p)
45
+  #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask_plus_70(p)
46
+  #define digitalPinToPort_DEBUG(p) digitalPinToPort_plus_70(p)
47
+  bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
48
+
49
+#else
50
+  #define digitalPinToTimer_DEBUG(p) digitalPinToTimer(p)
51
+  #define digitalPinToBitMask_DEBUG(p) digitalPinToBitMask(p)
52
+  #define digitalPinToPort_DEBUG(p) digitalPinToPort(p)
53
+  bool GET_PINMODE(int8_t pin) {return *portModeRegister(digitalPinToPort_DEBUG(pin)) & digitalPinToBitMask_DEBUG(pin); }
54
+  #define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
55
+#endif
56
+
57
+#define VALID_PIN(pin)) (pin >= 0 && pin < NUM_DIGITAL_PINS ? 1 : 0)
58
+#define DIGITAL_PIN_TO_ANALOG_PIN(p) int(p - analogInputToDigitalPin(0))
59
+#define IS_ANALOG(P) ((P) >= analogInputToDigitalPin(0) && ((P) <= analogInputToDigitalPin(15) || (P) <= analogInputToDigitalPin(7)))
60
+#define GET_ARRAY_PIN(p) pgm_read_byte(&pin_array[p].pin)
61
+
62
+void PRINT_ARRAY_NAME(uint8_t x) {
63
+  char *name_mem_pointer = (char*)pgm_read_word(&pin_array[x].name);
64
+  for (uint8_t y = 0; y < MAX_NAME_LENGTH; y++) {
65
+    char temp_char = pgm_read_byte(name_mem_pointer + y);
66
+    if (temp_char != 0)
67
+      MYSERIAL.write(temp_char);
68
+    else {
69
+      for (uint8_t i = 0; i < MAX_NAME_LENGTH - y; i++) MYSERIAL.write(' ');
70
+      break;
71
+    }
72
+  }
73
+}
74
+
75
+#define GET_ARRAY_IS_DIGITAL(x)   pgm_read_byte(&pin_array[x].is_digital)
76
+
77
+
78
+#if defined(__AVR_ATmega1284P__)  // 1284 IDE extensions set this to the number of
79
+  #undef NUM_DIGITAL_PINS         // digital only pins while all other CPUs have it
80
+  #define NUM_DIGITAL_PINS 32     // set to digital only + digital/analog
81
+#endif
82
+
83
+#define PWM_PRINT(V) do{ sprintf_P(buffer, PSTR("PWM:  %4d"), V); SERIAL_ECHO(buffer); }while(0)
84
+#define PWM_CASE(N,Z)                                           \
85
+  case TIMER##N##Z:                                             \
86
+    if (TCCR##N##A & (_BV(COM##N##Z##1) | _BV(COM##N##Z##0))) { \
87
+      PWM_PRINT(OCR##N##Z);                                     \
88
+      return true;                                              \
89
+    } else return false
90
+
91
+
92
+
93
+/**
94
+ * Print a pin's PWM status.
95
+ * Return true if it's currently a PWM pin.
96
+ */
97
+static bool pwm_status(uint8_t pin) {
98
+  char buffer[20];   // for the sprintf statements
99
+
100
+  switch (digitalPinToTimer_DEBUG(pin)) {
101
+
102
+    #if defined(TCCR0A) && defined(COM0A1)
103
+      #ifdef TIMER0A
104
+        #if !AVR_AT90USB1286_FAMILY  // not available in Teensyduino type IDEs
105
+          PWM_CASE(0, A);
106
+        #endif
107
+      #endif
108
+      PWM_CASE(0, B);
109
+    #endif
110
+
111
+    #if defined(TCCR1A) && defined(COM1A1)
112
+      PWM_CASE(1, A);
113
+      PWM_CASE(1, B);
114
+     #if defined(COM1C1) && defined(TIMER1C)
115
+      PWM_CASE(1, C);
116
+     #endif
117
+    #endif
118
+
119
+    #if defined(TCCR2A) && defined(COM2A1)
120
+      PWM_CASE(2, A);
121
+      PWM_CASE(2, B);
122
+    #endif
123
+
124
+    #if defined(TCCR3A) && defined(COM3A1)
125
+      PWM_CASE(3, A);
126
+      PWM_CASE(3, B);
127
+      #ifdef COM3C1
128
+        PWM_CASE(3, C);
129
+      #endif
130
+    #endif
131
+
132
+    #ifdef TCCR4A
133
+      PWM_CASE(4, A);
134
+      PWM_CASE(4, B);
135
+      PWM_CASE(4, C);
136
+    #endif
137
+
138
+    #if defined(TCCR5A) && defined(COM5A1)
139
+      PWM_CASE(5, A);
140
+      PWM_CASE(5, B);
141
+      PWM_CASE(5, C);
142
+    #endif
143
+
144
+    case NOT_ON_TIMER:
145
+    default:
146
+      return false;
147
+  }
148
+  SERIAL_PROTOCOL_SP(2);
149
+} // pwm_status
150
+
151
+
152
+const volatile uint8_t* const PWM_other[][3] PROGMEM = {
153
+    { &TCCR0A, &TCCR0B, &TIMSK0 },
154
+    { &TCCR1A, &TCCR1B, &TIMSK1 },
155
+  #if defined(TCCR2A) && defined(COM2A1)
156
+    { &TCCR2A, &TCCR2B, &TIMSK2 },
157
+  #endif
158
+  #if defined(TCCR3A) && defined(COM3A1)
159
+    { &TCCR3A, &TCCR3B, &TIMSK3 },
160
+  #endif
161
+  #ifdef TCCR4A
162
+    { &TCCR4A, &TCCR4B, &TIMSK4 },
163
+  #endif
164
+  #if defined(TCCR5A) && defined(COM5A1)
165
+    { &TCCR5A, &TCCR5B, &TIMSK5 },
166
+  #endif
167
+};
168
+
169
+
170
+const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
171
+
172
+  #ifdef TIMER0A
173
+    { &OCR0A, &OCR0B, 0 },
174
+  #else
175
+    { 0, &OCR0B, 0 },
176
+  #endif
177
+
178
+  #if defined(COM1C1) && defined(TIMER1C)
179
+   { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, (const uint8_t*)&OCR1C },
180
+  #else
181
+   { (const uint8_t*)&OCR1A, (const uint8_t*)&OCR1B, 0 },
182
+  #endif
183
+
184
+  #if defined(TCCR2A) && defined(COM2A1)
185
+    { &OCR2A, &OCR2B, 0 },
186
+  #endif
187
+
188
+  #if defined(TCCR3A) && defined(COM3A1)
189
+    #ifdef COM3C1
190
+      { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, (const uint8_t*)&OCR3C },
191
+    #else
192
+      { (const uint8_t*)&OCR3A, (const uint8_t*)&OCR3B, 0 },
193
+    #endif
194
+  #endif
195
+
196
+  #ifdef TCCR4A
197
+    { (const uint8_t*)&OCR4A, (const uint8_t*)&OCR4B, (const uint8_t*)&OCR4C },
198
+  #endif
199
+
200
+  #if defined(TCCR5A) && defined(COM5A1)
201
+    { (const uint8_t*)&OCR5A, (const uint8_t*)&OCR5B, (const uint8_t*)&OCR5C },
202
+  #endif
203
+};
204
+
205
+
206
+#define TCCR_A(T)   pgm_read_word(&PWM_other[T][0])
207
+#define TCCR_B(T)   pgm_read_word(&PWM_other[T][1])
208
+#define TIMSK(T)    pgm_read_word(&PWM_other[T][2])
209
+#define CS_0       0
210
+#define CS_1       1
211
+#define CS_2       2
212
+#define WGM_0      0
213
+#define WGM_1      1
214
+#define WGM_2      3
215
+#define WGM_3      4
216
+#define TOIE       0
217
+
218
+#define OCR_VAL(T, L)   pgm_read_word(&PWM_OCR[T][L])
219
+
220
+static void err_is_counter()     { SERIAL_PROTOCOLPGM("   non-standard PWM mode"); }
221
+static void err_is_interrupt()   { SERIAL_PROTOCOLPGM("   compare interrupt enabled"); }
222
+static void err_prob_interrupt() { SERIAL_PROTOCOLPGM("   overflow interrupt enabled"); }
223
+static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); }
224
+
225
+void com_print(uint8_t N, uint8_t Z) {
226
+  const uint8_t *TCCRA = (uint8_t*)TCCR_A(N);
227
+  SERIAL_PROTOCOLPGM("    COM");
228
+  SERIAL_PROTOCOLCHAR(N + '0');
229
+  switch (Z) {
230
+    case 'A':
231
+      SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6));
232
+      break;
233
+    case 'B':
234
+      SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4));
235
+      break;
236
+    case 'C':
237
+      SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2));
238
+      break;
239
+  }
240
+}
241
+
242
+void timer_prefix(uint8_t T, char L, uint8_t N) {  // T - timer    L - pwm  N - WGM bit layout
243
+  char buffer[20];   // for the sprintf statements
244
+  const uint8_t *TCCRB = (uint8_t*)TCCR_B(T),
245
+                *TCCRA = (uint8_t*)TCCR_A(T);
246
+  uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1))));
247
+  if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1);
248
+
249
+  SERIAL_PROTOCOLPGM("    TIMER");
250
+  SERIAL_PROTOCOLCHAR(T + '0');
251
+  SERIAL_PROTOCOLCHAR(L);
252
+  SERIAL_PROTOCOL_SP(3);
253
+
254
+  if (N == 3) {
255
+    const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A');
256
+    PWM_PRINT(*OCRVAL8);
257
+  }
258
+  else {
259
+    const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A');
260
+    PWM_PRINT(*OCRVAL16);
261
+  }
262
+  SERIAL_PROTOCOLPAIR("    WGM: ", WGM);
263
+  com_print(T,L);
264
+  SERIAL_PROTOCOLPAIR("    CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) ));
265
+
266
+  SERIAL_PROTOCOLPGM("    TCCR");
267
+  SERIAL_PROTOCOLCHAR(T + '0');
268
+  SERIAL_PROTOCOLPAIR("A: ", *TCCRA);
269
+
270
+  SERIAL_PROTOCOLPGM("    TCCR");
271
+  SERIAL_PROTOCOLCHAR(T + '0');
272
+  SERIAL_PROTOCOLPAIR("B: ", *TCCRB);
273
+
274
+  const uint8_t *TMSK = (uint8_t*)TIMSK(T);
275
+  SERIAL_PROTOCOLPGM("    TIMSK");
276
+  SERIAL_PROTOCOLCHAR(T + '0');
277
+  SERIAL_PROTOCOLPAIR(": ", *TMSK);
278
+
279
+  const uint8_t OCIE = L - 'A' + 1;
280
+  if (N == 3) { if (WGM == 0 || WGM == 2 || WGM ==  4 || WGM ==  6) err_is_counter(); }
281
+  else        { if (WGM == 0 || WGM == 4 || WGM == 12 || WGM == 13) err_is_counter(); }
282
+  if (TEST(*TMSK, OCIE)) err_is_interrupt();
283
+  if (TEST(*TMSK, TOIE)) err_prob_interrupt();
284
+}
285
+
286
+static void pwm_details(uint8_t pin) {
287
+  switch (digitalPinToTimer_DEBUG(pin)) {
288
+
289
+    #if defined(TCCR0A) && defined(COM0A1)
290
+      #ifdef TIMER0A
291
+        #if !AVR_AT90USB1286_FAMILY  // not available in Teensyduino type IDEs
292
+          case TIMER0A: timer_prefix(0, 'A', 3); break;
293
+        #endif
294
+      #endif
295
+      case TIMER0B: timer_prefix(0, 'B', 3); break;
296
+    #endif
297
+
298
+    #if defined(TCCR1A) && defined(COM1A1)
299
+      case TIMER1A: timer_prefix(1, 'A', 4); break;
300
+      case TIMER1B: timer_prefix(1, 'B', 4); break;
301
+      #if defined(COM1C1) && defined(TIMER1C)
302
+        case TIMER1C: timer_prefix(1, 'C', 4); break;
303
+      #endif
304
+    #endif
305
+
306
+    #if defined(TCCR2A) && defined(COM2A1)
307
+      case TIMER2A: timer_prefix(2, 'A', 3); break;
308
+      case TIMER2B: timer_prefix(2, 'B', 3); break;
309
+    #endif
310
+
311
+    #if defined(TCCR3A) && defined(COM3A1)
312
+      case TIMER3A: timer_prefix(3, 'A', 4); break;
313
+      case TIMER3B: timer_prefix(3, 'B', 4); break;
314
+      #ifdef COM3C1
315
+        case TIMER3C: timer_prefix(3, 'C', 4); break;
316
+      #endif
317
+    #endif
318
+
319
+    #ifdef TCCR4A
320
+      case TIMER4A: timer_prefix(4, 'A', 4); break;
321
+      case TIMER4B: timer_prefix(4, 'B', 4); break;
322
+      case TIMER4C: timer_prefix(4, 'C', 4); break;
323
+    #endif
324
+
325
+    #if defined(TCCR5A) && defined(COM5A1)
326
+      case TIMER5A: timer_prefix(5, 'A', 4); break;
327
+      case TIMER5B: timer_prefix(5, 'B', 4); break;
328
+      case TIMER5C: timer_prefix(5, 'C', 4); break;
329
+    #endif
330
+
331
+    case NOT_ON_TIMER: break;
332
+
333
+  }
334
+  SERIAL_PROTOCOLPGM("  ");
335
+
336
+  // on pins that have two PWMs, print info on second PWM
337
+  #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY
338
+    // looking for port B7 - PWMs 0A and 1C
339
+    if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) {
340
+      #if !AVR_AT90USB1286_FAMILY
341
+        SERIAL_PROTOCOLPGM("\n .");
342
+        SERIAL_PROTOCOL_SP(18);
343
+        SERIAL_PROTOCOLPGM("TIMER1C");
344
+        print_is_also_tied();
345
+        timer_prefix(1, 'C', 4);
346
+      #else
347
+        SERIAL_PROTOCOLPGM("\n .");
348
+        SERIAL_PROTOCOL_SP(18);
349
+        SERIAL_PROTOCOLPGM("TIMER0A");
350
+        print_is_also_tied();
351
+        timer_prefix(0, 'A', 3);
352
+      #endif
353
+    }
354
+  #endif
355
+} // pwm_details
356
+
357
+
358
+#ifndef digitalRead_mod                   // Use Teensyduino's version of digitalRead - it doesn't disable the PWMs
359
+  int digitalRead_mod(const int8_t pin) { // same as digitalRead except the PWM stop section has been removed
360
+    const uint8_t port = digitalPinToPort_DEBUG(pin);
361
+    return (port != NOT_A_PIN) && (*portInputRegister(port) & digitalPinToBitMask_DEBUG(pin)) ? HIGH : LOW;
362
+  }
363
+#endif
364
+
365
+#ifndef PRINT_PORT(p)
366
+  void print_port(int8_t pin) {   // print port number
367
+    #ifdef digitalPinToPort_DEBUG
368
+      uint8_t x;
369
+      SERIAL_PROTOCOLPGM("  Port: ");
370
+      #if AVR_AT90USB1286_FAMILY
371
+        x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64;
372
+      #else
373
+        x = digitalPinToPort_DEBUG(pin) + 64;
374
+      #endif
375
+      SERIAL_CHAR(x);
376
+
377
+      #if AVR_AT90USB1286_FAMILY
378
+        if (pin == 46)
379
+          x = '2';
380
+        else if (pin == 47)
381
+          x = '3';
382
+        else {
383
+          uint8_t temp = digitalPinToBitMask_DEBUG(pin);
384
+          for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
385
+        }
386
+      #else
387
+        uint8_t temp = digitalPinToBitMask_DEBUG(pin);
388
+        for (x = '0'; x < '9' && temp != 1; x++) temp >>= 1;
389
+      #endif
390
+      SERIAL_CHAR(x);
391
+    #else
392
+      SERIAL_PROTOCOL_SP(10);
393
+    #endif
394
+  }
395
+  
396
+  #define PRINT_PORT(p) print_port(p)
397
+#endif

+ 15
- 11
Marlin/src/HAL/HAL_AVR/pinsDebug_Teensyduino.h View File

@@ -25,16 +25,21 @@
25 25
 //  do not function the same as the other Arduino extensions
26 26
 //
27 27
 
28
-#ifndef __PINSDEBUG_TEENSYDUINO_H__
29
-#define __PINSDEBUG_TEENSYDUINO_H__
30 28
 
31
-#undef NUM_DIGITAL_PINS
32
-#define NUM_DIGITAL_PINS 48  // Teensy says 46 but FASTIO is 48
29
+#define TEENSYDUINO_IDE
33 30
 
34
-// "digitalPinToPort" function just returns the pin number so need to create our own.
35
-// Can't use the name "digitalPinToPort" for our own because it interferes with the
36
-// FAST_PWM_FAN function if we do
31
+//digitalPinToTimer(pin) function works like Arduino but Timers are not defined
32
+#define TIMER0B 1
33
+#define TIMER1A 7
34
+#define TIMER1B 8
35
+#define TIMER1C 9
36
+#define TIMER2A 6
37
+#define TIMER2B 2
38
+#define TIMER3A 5
39
+#define TIMER3B 4
40
+#define TIMER3C 3
37 41
 
42
+// digitalPinToPort function just returns the pin number so need to create our own
38 43
 #define PA 1
39 44
 #define PB 2
40 45
 #define PC 3
@@ -42,8 +47,9 @@
42 47
 #define PE 5
43 48
 #define PF 6
44 49
 
50
+#undef digitalPinToPort
45 51
 
46
-const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
52
+const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
47 53
   PD, // 0  - PD0 - INT0 - PWM
48 54
   PD, // 1  - PD1 - INT1 - PWM
49 55
   PD, // 2  - PD2 - INT2 - RX
@@ -94,7 +100,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
94 100
   PE, // 47 - PE3 (not defined in teensyduino)
95 101
 };
96 102
 
97
-#define digitalPinToPort_Teensy(P) ( pgm_read_byte( digital_pin_to_port_PGM_Teensy + (P) ) )
103
+#define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
98 104
 
99 105
 // digitalPinToBitMask(pin) is OK
100 106
 
@@ -102,5 +108,3 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_Teensy[] = {
102 108
                                              // disable the PWMs so we can use it as is
103 109
 
104 110
 // portModeRegister(pin) is OK
105
-
106
-#endif // __PINSDEBUG_TEENSYDUINO_H__

+ 29
- 0
Marlin/src/HAL/HAL_DUE/SanityCheck_Due.h View File

@@ -0,0 +1,29 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Test Arduino Due specific configuration values for errors at compile-time.
25
+ */
26
+
27
+/**
28
+ * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
29
+ */

+ 71
- 0
Marlin/src/HAL/HAL_LPC1768/SanityCheck_Re_ARM.h View File

@@ -0,0 +1,71 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Test Re-ARM specific configuration values for errors at compile-time.
25
+ */
26
+
27
+/**
28
+ * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
29
+ */
30
+
31
+#if ENABLED(SPINDLE_LASER_ENABLE)
32
+  #if !PIN_EXISTS(SPINDLE_LASER_ENABLE)
33
+    #error "SPINDLE_LASER_ENABLE requires SPINDLE_LASER_ENABLE_PIN."
34
+  #elif SPINDLE_DIR_CHANGE && !PIN_EXISTS(SPINDLE_DIR)
35
+    #error "SPINDLE_DIR_PIN not defined."
36
+  #elif ENABLED(SPINDLE_LASER_PWM) && PIN_EXISTS(SPINDLE_LASER_PWM)
37
+    #if !PWM_PIN(SPINDLE_LASER_PWM_PIN)
38
+      #error "SPINDLE_LASER_PWM_PIN not assigned to a PWM pin."
39
+    #elif !(SPINDLE_LASER_PWM_PIN == 4 || SPINDLE_LASER_PWM_PIN == 6 || SPINDLE_LASER_PWM_PIN == 11)
40
+      #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
41
+    #elif SPINDLE_LASER_POWERUP_DELAY < 1
42
+      #error "SPINDLE_LASER_POWERUP_DELAY must be greater than 0."
43
+    #elif SPINDLE_LASER_POWERDOWN_DELAY < 1
44
+      #error "SPINDLE_LASER_POWERDOWN_DELAY must be greater than 0."
45
+    #elif !defined(SPINDLE_LASER_PWM_INVERT)
46
+      #error "SPINDLE_LASER_PWM_INVERT missing."
47
+    #elif !defined(SPEED_POWER_SLOPE) || !defined(SPEED_POWER_INTERCEPT) || !defined(SPEED_POWER_MIN) || !defined(SPEED_POWER_MAX)
48
+      #error "SPINDLE_LASER_PWM equation constant(s) missing."
49
+    #elif PIN_EXISTS(CASE_LIGHT) && SPINDLE_LASER_PWM_PIN == CASE_LIGHT_PIN
50
+      #error "SPINDLE_LASER_PWM_PIN is used by CASE_LIGHT_PIN."
51
+    #elif PIN_EXISTS(E0_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E0_AUTO_FAN_PIN
52
+      #error "SPINDLE_LASER_PWM_PIN is used by E0_AUTO_FAN_PIN."
53
+    #elif PIN_EXISTS(E1_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E1_AUTO_FAN_PIN
54
+      #error "SPINDLE_LASER_PWM_PIN is used by E1_AUTO_FAN_PIN."
55
+    #elif PIN_EXISTS(E2_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E2_AUTO_FAN_PIN
56
+      #error "SPINDLE_LASER_PWM_PIN is used by E2_AUTO_FAN_PIN."
57
+    #elif PIN_EXISTS(E3_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E3_AUTO_FAN_PIN
58
+      #error "SPINDLE_LASER_PWM_PIN is used by E3_AUTO_FAN_PIN."
59
+    #elif PIN_EXISTS(E4_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E4_AUTO_FAN_PIN
60
+      #error "SPINDLE_LASER_PWM_PIN is used by E4_AUTO_FAN_PIN."
61
+    #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN
62
+      #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN."
63
+    #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN
64
+      #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN."
65
+    #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN
66
+      #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN."
67
+    #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN
68
+      #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN."
69
+    #endif
70
+  #endif
71
+#endif // SPINDLE_LASER_ENABLE

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/arduino.cpp View File

@@ -22,8 +22,8 @@
22 22
 
23 23
 #ifdef TARGET_LPC1768
24 24
 #include <lpc17xx_pinsel.h>
25
-#include "../../../macros.h"
26 25
 #include "HAL.h"
26
+#include "../../macros.h"
27 27
 
28 28
 // Interrupts
29 29
 void cli(void) { __disable_irq(); } // Disable

+ 14
- 1
Marlin/src/HAL/HAL_LPC1768/pinmap_re_arm.h View File

@@ -63,7 +63,6 @@ const adc_pin_data adc_pin_map[] = {
63 63
 #define VALID_PIN(r)  (r <   0 ? 0 :\
64 64
                        r ==  7 ? 0 :\
65 65
                        r == 17 ? 0 :\
66
-                       r == 17 ? 0 :\
67 66
                        r == 22 ? 0 :\
68 67
                        r == 23 ? 0 :\
69 68
                        r == 25 ? 0 :\
@@ -82,6 +81,20 @@ const adc_pin_data adc_pin_map[] = {
82 81
                        r == 66 ? 0 :\
83 82
                        r >= NUM_DIGITAL_PINS ? 0 : 1)
84 83
 
84
+#define PWM_PIN(r)  (r <   0 ? 0 :\
85
+                       r ==  3 ? 1 :\
86
+                       r ==  4 ? 1 :\
87
+                       r ==  6 ? 1 :\
88
+                       r ==  9 ? 1 :\
89
+                       r == 10 ? 1 :\
90
+                       r == 11 ? 1 :\
91
+                       r == 14 ? 1 :\
92
+                       r == 26 ? 1 :\
93
+                       r == 46 ? 1 :\
94
+                       r == 53 ? 1 :\
95
+                       r == 54 ? 1 :\
96
+                       r == 60 ? 1 : 0)
97
+
85 98
 const pin_data pin_map[] = { // pin map for variable pin function
86 99
   {0,3},        //  DIO0   RXD0             A6               J4-4                           AUX-1
87 100
   {0,2},        //  DIO1   TXD0             A7               J4-5                           AUX-1

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/pinmapping.h View File

@@ -27,7 +27,7 @@
27 27
 struct pin_data { uint8_t port, pin; };
28 28
 struct adc_pin_data { uint8_t port, pin, adc; };
29 29
 
30
-#if ENABLED(IS_REARM)
30
+#if defined(IS_REARM)
31 31
   #include "pinmap_re_arm.h"
32 32
 #else
33 33
   #error "HAL: LPC1768: No defined pin-mapping"

+ 23
- 31
Marlin/src/HAL/HAL_LPC1768/pinsDebug_Re_ARM.h View File

@@ -1,5 +1,5 @@
1 1
 /**
2
-  * Marlin 3D Printer Firmware
2
+ * Marlin 3D Printer Firmware
3 3
  * Copyright (C) 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4 4
  *
5 5
  * Based on Sprinter and grbl.
@@ -19,68 +19,60 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
- 
22
+
23 23
 /**
24 24
  * Support routines for Re-ARM board
25
- */
26
-
25
+*/
27 26
 
28
- 
29
-typedef struct {
30
-  int8_t pin;
31
-  bool output;
32
-  bool analog;
33
-  uint8_t resistors;
34
-  bool open_drain;
35
-  char function_string[15];
36
-} pin_info;
27
+bool pin_Re_ARM_output;
28
+bool pin_Re_ARM_analog;
29
+int8_t pin_Re_ARM_pin;
37 30
 
38
-pin_info pin_Re_ARM;
39
- 
40 31
 void get_pin_info(int8_t pin) {
41
-  pin_Re_ARM.analog = 0;
42
-  pin_Re_ARM.pin = pin;
32
+
33
+if (pin == 7) return;
34
+  pin_Re_ARM_analog = 0;
35
+  pin_Re_ARM_pin = pin;
43 36
   int8_t pin_port = pin_map[pin].port;
44 37
   int8_t pin_port_pin = pin_map[pin].pin;
45
- 
46 38
   // active ADC function/mode/code values for PINSEL registers
47 39
   int8_t ADC_pin_mode = pin_port == 0 && pin_port_pin == 2  ? 2 :
48 40
                         pin_port == 0 && pin_port_pin == 3  ? 2 :
49
-                        pin_port == 0 && pin_port_pin == 23 ? 1 : 
41
+                        pin_port == 0 && pin_port_pin == 23 ? 1 :
50 42
                         pin_port == 0 && pin_port_pin == 24 ? 1 :
51 43
                         pin_port == 0 && pin_port_pin == 25 ? 1 :
52 44
                         pin_port == 0 && pin_port_pin == 26 ? 1 :
53 45
                         pin_port == 1 && pin_port_pin == 30 ? 3 :
54
-                        pin_port == 1 && pin_port_pin == 31 ? 3 : -1;       
55
-  //get appropriate PINSEL register                                         
46
+                        pin_port == 1 && pin_port_pin == 31 ? 3 : -1;
47
+  //get appropriate PINSEL register
56 48
   volatile uint32_t * pinsel_reg = (pin_port == 0 && pin_port_pin <= 15) ? &LPC_PINCON->PINSEL0 :
57 49
                                    (pin_port == 0)                       ? &LPC_PINCON->PINSEL1 :
58 50
                                    (pin_port == 1 && pin_port_pin <= 15) ? &LPC_PINCON->PINSEL2 :
59 51
                                     pin_port == 1                        ? &LPC_PINCON->PINSEL3 :
60 52
                                     pin_port == 2                        ? &LPC_PINCON->PINSEL4 :
61
-                                    pin_port == 3                        ? &LPC_PINCON->PINSEL7 : &LPC_PINCON->PINSEL9;                                                    
62
-
53
+                                    pin_port == 3                        ? &LPC_PINCON->PINSEL7 : &LPC_PINCON->PINSEL9;
63 54
   uint8_t pinsel_start_bit = pin_port_pin > 15 ? 2 * (pin_port_pin - 16) : 2 * pin_port_pin;
64 55
   uint8_t pin_mode = (uint8_t) ((*pinsel_reg >> pinsel_start_bit) & 0x3);
65
-  
66 56
   uint32_t * FIO_reg[5] PROGMEM = {(uint32_t*) 0x2009C000,(uint32_t*)  0x2009C020,(uint32_t*)  0x2009C040,(uint32_t*)  0x2009C060,(uint32_t*)  0x2009C080};
67
-  pin_Re_ARM.output = (*FIO_reg[pin_map[pin].port] >> pin_map[pin].pin) & 1; //input/output state except if active ADC
57
+  pin_Re_ARM_output = (*FIO_reg[pin_map[pin].port] >> pin_map[pin].pin) & 1; //input/output state except if active ADC
68 58
 
69 59
   if (pin_mode) {  // if function/mode/code value not 0 then could be an active analog channel
70 60
     if (ADC_pin_mode == pin_mode) {  // found an active analog pin
71
-      pin_Re_ARM.output = 0;
72
-      pin_Re_ARM.analog = 1;
73
-    }  
61
+      pin_Re_ARM_output = 0;
62
+      pin_Re_ARM_analog = 1;
63
+    }
74 64
   }
75 65
 }
76 66
 
77 67
 /**
78 68
  * translation of routines & variables used by pinsDebug.h
79 69
  */
80
- 
70
+
71
+#define pwm_details(pin) pin = pin    // do nothing  // print PWM details
72
+#define pwm_status(pin) false //Print a pin's PWM status. Return true if it's currently a PWM pin.
81 73
 #define GET_PIN_INFO(pin) get_pin_info(pin)
82 74
 #define IS_ANALOG(P) (DIGITAL_PIN_TO_ANALOG_PIN(P) >= 0 ? 1 : 0)
83
-#define GET_PINMODE(pin) pin_Re_ARM.output
75
+#define GET_PINMODE(pin) pin_Re_ARM_output
84 76
 #define digitalRead_mod(p)  digitalRead(p)
85 77
 #define digitalPinToPort_DEBUG(p)  0
86 78
 #define digitalPinToBitMask_DEBUG(pin) 0
@@ -89,4 +81,4 @@ void get_pin_info(int8_t pin) {
89 81
 #define NAME_FORMAT(p) PSTR("%-##p##s")
90 82
 //  #define PRINT_ARRAY_NAME(x)  do {sprintf_P(buffer, NAME_FORMAT(MAX_NAME_LENGTH) , pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
91 83
 #define PRINT_ARRAY_NAME(x)  do {sprintf_P(buffer, PSTR("%-35s") , pin_array[x].name); SERIAL_ECHO(buffer);} while (0)
92
-#define GET_ARRAY_IS_DIGITAL(x)  !pin_Re_ARM.analog
84
+#define GET_ARRAY_IS_DIGITAL(x)  !pin_Re_ARM_analog

+ 37
- 0
Marlin/src/HAL/HAL_SanityCheck.h View File

@@ -0,0 +1,37 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#ifndef HAL_SANITYCHECK_H
24
+
25
+#ifdef ARDUINO_ARCH_AVR
26
+  #include "HAL_AVR/SanityCheck_AVR_8_bit.h"
27
+#elif defined(ARDUINO_ARCH_SAM)
28
+  #include "HAL_DUE/SanityCheck_Due.h"
29
+#elif IS_32BIT_TEENSY
30
+  #include "HAL_TEENSY35_36/SanityCheck_Teensy_35_36.h"
31
+#elif defined(TARGET_LPC1768)
32
+  #include "HAL_LPC1768/SanityCheck_Re_ARM.h"
33
+#else
34
+  #error Unsupported Platform!
35
+#endif
36
+ 
37
+#endif

+ 29
- 0
Marlin/src/HAL/HAL_TEENSY35_36/SanityCheck_Teensy_35_36.h View File

@@ -0,0 +1,29 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016, 2017 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * Test TEENSY35_36 specific configuration values for errors at compile-time.
25
+ */
26
+
27
+/**
28
+ * Require gcc 4.7 or newer (first included with Arduino 1.6.8) for C++11 features.
29
+ */

+ 13
- 11
Marlin/src/HAL/HAL_pinsDebug.h View File

@@ -22,16 +22,18 @@
22 22
 
23 23
 #ifndef HAL_PINSDEBUG_H
24 24
 
25
-#ifdef ARDUINO_ARCH_AVR
26
-  #include "HAL_AVR/HAL_pinsDebug_AVR.h"
27
-#elif defined(ARDUINO_ARCH_SAM)
28
-  #include "HAL_DUE/HAL_pinsDebug_Due.h"
29
-#elif IS_32BIT_TEENSY
30
-  #include "HAL_TEENSY35_36/HAL_pinsDebug_Teensy.h"
31
-#elif defined(TARGET_LPC1768)
32
-  #include "HAL_LPC1768/HAL_pinsDebug.h"
33
-#else
34
-  #error Unsupported Platform!
35
-#endif
25
+#if defined(PINS_DEBUGGING)
26
+  #ifdef ARDUINO_ARCH_AVR
27
+    #include "HAL_AVR/pinsDebug_AVR_8_bit.h"
28
+  #elif defined(ARDUINO_ARCH_SAM)
29
+    #include "HAL_DUE/HAL_pinsDebug_Due.h"
30
+  #elif IS_32BIT_TEENSY
31
+    #include "HAL_TEENSY35_36/HAL_pinsDebug_Teensy.h"
32
+  #elif defined(TARGET_LPC1768)
33
+    #include "HAL_LPC1768/pinsDebug_Re_ARM.h"
34
+  #else
35
+    #error Unsupported Platform!
36
+  #endif
37
+#endif  
36 38
 
37 39
 #endif

Loading…
Cancel
Save