Browse Source

Merge pull request #3398 from thinkyhead/rc_sensor_per_extruder

Catch a TEMP_SENSOR error before a pins issue
Scott Lahteine 8 years ago
parent
commit
9536e28978
1 changed files with 11 additions and 13 deletions
  1. 11
    13
      Marlin/SanityCheck.h

+ 11
- 13
Marlin/SanityCheck.h View File

@@ -368,27 +368,29 @@
368 368
  * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set.
369 369
  */
370 370
 #if EXTRUDERS > 3
371
-  #if !HAS_HEATER_3
371
+  #if TEMP_SENSOR_3 == 0
372
+    #error TEMP_SENSOR_3 is required with 4 EXTRUDERS.
373
+  #elif !HAS_HEATER_3
372 374
     #error HEATER_3_PIN not defined for this board.
373 375
   #elif !PIN_EXISTS(TEMP_3)
374 376
     #error TEMP_3_PIN not defined for this board.
375 377
   #elif !PIN_EXISTS(E3_STEP) || !PIN_EXISTS(E3_DIR) || !PIN_EXISTS(E3_ENABLE)
376 378
     #error E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board.
377
-  #elif TEMP_SENSOR_3 == 0
378
-    #error TEMP_SENSOR_3 is required with 4 EXTRUDERS.
379 379
   #endif
380 380
 #elif EXTRUDERS > 2
381
-  #if !HAS_HEATER_2
381
+  #if TEMP_SENSOR_2 == 0
382
+    #error TEMP_SENSOR_2 is required with 3 or more EXTRUDERS.
383
+  #elif !HAS_HEATER_2
382 384
     #error HEATER_2_PIN not defined for this board.
383 385
   #elif !PIN_EXISTS(TEMP_2)
384 386
     #error TEMP_2_PIN not defined for this board.
385 387
   #elif !PIN_EXISTS(E2_STEP) || !PIN_EXISTS(E2_DIR) || !PIN_EXISTS(E2_ENABLE)
386 388
     #error E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board.
387
-  #elif TEMP_SENSOR_2 == 0
388
-    #error TEMP_SENSOR_2 is required with 3 or more EXTRUDERS.
389 389
   #endif
390 390
 #elif EXTRUDERS > 1
391
-  #if !PIN_EXISTS(TEMP_1)
391
+  #if TEMP_SENSOR_1 == 0
392
+    #error TEMP_SENSOR_1 is required with 2 or more EXTRUDERS.
393
+  #elif !PIN_EXISTS(TEMP_1)
392 394
     #error TEMP_1_PIN not defined for this board.
393 395
   #elif !PIN_EXISTS(E1_STEP) || !PIN_EXISTS(E1_DIR) || !PIN_EXISTS(E1_ENABLE)
394 396
     #error E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board.
@@ -401,12 +403,8 @@
401 403
   #endif
402 404
 #endif
403 405
 
404
-#if TEMP_SENSOR_1 == 0
405
-  #if EXTRUDERS > 1
406
-    #error TEMP_SENSOR_1 is required with 2 or more EXTRUDERS.
407
-  #elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
408
-    #error TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT.
409
-  #endif
406
+#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) && TEMP_SENSOR_1 == 0
407
+  #error TEMP_SENSOR_1 is required with TEMP_SENSOR_1_AS_REDUNDANT.
410 408
 #endif
411 409
 
412 410
 #if !HAS_HEATER_0

Loading…
Cancel
Save