Ver código fonte

And another compile fix...

leptun 4 anos atrás
pai
commit
0ed4a23ae7
3 arquivos alterados com 24 adições e 14 exclusões
  1. 6 2
      Firmware/Marlin_main.cpp
  2. 3 7
      Firmware/backlight.h
  3. 15 5
      Firmware/ultralcd.cpp

+ 6 - 2
Firmware/Marlin_main.cpp

@@ -2769,7 +2769,9 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
 	#ifdef TMC2130
 	FORCE_HIGH_POWER_START;
 	#endif // TMC2130
-	FORCE_BL_ON_START;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_START;
+    #endif // LCD_BL_PIN
 	// Only Z calibration?
 	if (!onlyZ)
 	{
@@ -2958,7 +2960,9 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
 #ifdef TMC2130
 	FORCE_HIGH_POWER_END;
 #endif // TMC2130
-	FORCE_BL_ON_END;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_END;
+    #endif // LCD_BL_PIN
 	return final_result;
 }
 

+ 3 - 7
Firmware/backlight.h

@@ -19,13 +19,9 @@ extern uint8_t backlightMode;
 extern bool backlightSupport;
 extern int16_t backlightTimer_period;
 
-#ifdef LCD_BL_PIN
-    #define FORCE_BL_ON_START   force_bl_on(true)
-    #define FORCE_BL_ON_END	    force_bl_on(false)
-#else
-    #define FORCE_BL_ON_START
-    #define FORCE_BL_ON_END
-#endif
+#define FORCE_BL_ON_START force_bl_on(true)
+#define FORCE_BL_ON_END force_bl_on(false)
+
 extern void force_bl_on(bool section_start);
 extern void backlight_update();
 extern void backlight_init();

+ 15 - 5
Firmware/ultralcd.cpp

@@ -5019,7 +5019,9 @@ void lcd_wizard(WizState state)
 	// Make sure EEPROM_WIZARD_ACTIVE is true if entering using different entry point
 	// other than WizState::Run - it is useful for debugging wizard.
 	if (state != S::Run) eeprom_update_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1);
-	FORCE_BL_ON_START;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_START;
+    #endif // LCD_BL_PIN
 	while (!end) {
 		printf_P(PSTR("Wizard state: %d\n"), state);
 		switch (state) {
@@ -5157,7 +5159,9 @@ void lcd_wizard(WizState state)
 		}
 	}
 
-	FORCE_BL_ON_END;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_END;
+    #endif // LCD_BL_PIN
 	printf_P(_N("Wizard end state: %d\n"), state);
 	switch (state) { //final message
 	case S::Restore: //printer was already calibrated
@@ -7394,7 +7398,9 @@ bool lcd_selftest()
 	#ifdef TMC2130
 	  FORCE_HIGH_POWER_START;
 	#endif // TMC2130
-    FORCE_BL_ON_START;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_START;
+    #endif // LCD_BL_PIN
 	_delay(2000);
 	KEEPALIVE_STATE(IN_HANDLER);
 
@@ -7614,7 +7620,9 @@ bool lcd_selftest()
 	#ifdef TMC2130
 	  FORCE_HIGH_POWER_END;
 	#endif // TMC2130
-    FORCE_BL_ON_END;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_END;
+    #endif // LCD_BL_PIN
 	KEEPALIVE_STATE(NOT_BUSY);
 	return(_result);
 }
@@ -8024,7 +8032,9 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
 static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2)
 {
 	lcd_beeper_quick_feedback();
-    FORCE_BL_ON_END;
+    #ifdef LCD_BL_PIN
+        FORCE_BL_ON_END;
+    #endif // LCD_BL_PIN
 
 	target_temperature[0] = 0;
 	target_temperature_bed = 0;