Browse Source

Allow TEMP_STAT_LEDS with only one LED defined

Scott Lahteine 8 years ago
parent
commit
ada935de87
2 changed files with 11 additions and 5 deletions
  1. 8
    2
      Marlin/Marlin_main.cpp
  2. 3
    3
      Marlin/SanityCheck.h

+ 8
- 2
Marlin/Marlin_main.cpp View File

9244
       bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
9244
       bool new_led = (max_temp > 55.0) ? true : (max_temp < 54.0) ? false : red_led;
9245
       if (new_led != red_led) {
9245
       if (new_led != red_led) {
9246
         red_led = new_led;
9246
         red_led = new_led;
9247
-        WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW);
9248
-        WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH);
9247
+        #if PIN_EXISTS(STAT_LED_RED)
9248
+          WRITE(STAT_LED_RED_PIN, new_led ? HIGH : LOW);
9249
+          #if PIN_EXISTS(STAT_LED_BLUE)
9250
+            WRITE(STAT_LED_BLUE_PIN, new_led ? LOW : HIGH);
9251
+          #endif
9252
+        #else
9253
+          WRITE(STAT_LED_BLUE_PIN, new_led ? HIGH : LOW);
9254
+        #endif
9249
       }
9255
       }
9250
     }
9256
     }
9251
   }
9257
   }

+ 3
- 3
Marlin/SanityCheck.h View File

770
 /**
770
 /**
771
  * Temperature status LEDs
771
  * Temperature status LEDs
772
  */
772
  */
773
-#if ENABLED(TEMP_STAT_LEDS) && !(PIN_EXISTS(STAT_LED_RED) && PIN_EXISTS(STAT_LED_BLUE))
774
-  #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN and STAT_LED_BLUE_PIN."
773
+#if ENABLED(TEMP_STAT_LEDS) && !PIN_EXISTS(STAT_LED_RED) && !PIN_EXISTS(STAT_LED_BLUE)
774
+  #error "TEMP_STAT_LEDS requires STAT_LED_RED_PIN or STAT_LED_BLUE_PIN, preferably both."
775
 #endif
775
 #endif
776
 
776
 
777
 /**
777
 /**
942
 #else
942
 #else
943
   #define COUNT_LCD_13 COUNT_LCD_12
943
   #define COUNT_LCD_13 COUNT_LCD_12
944
 #endif
944
 #endif
945
-#if ENABLED(REPRAPWORLD_KEYPAD)
945
+#if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(CARTESIO_UI)
946
   #define COUNT_LCD_14 INCREMENT(COUNT_LCD_13)
946
   #define COUNT_LCD_14 INCREMENT(COUNT_LCD_13)
947
 #else
947
 #else
948
   #define COUNT_LCD_14 COUNT_LCD_13
948
   #define COUNT_LCD_14 COUNT_LCD_13

Loading…
Cancel
Save