Quellcode durchsuchen

Patch for caselight + lcd compile issues

Scott Lahteine vor 7 Jahren
Ursprung
Commit
bfd1e75c04

+ 1
- 2
Marlin/src/feature/caselight.cpp Datei anzeigen

@@ -24,7 +24,7 @@
24 24
 
25 25
 #if HAS_CASE_LIGHT
26 26
 
27
-int case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
27
+uint8_t case_light_brightness = CASE_LIGHT_DEFAULT_BRIGHTNESS;
28 28
 bool case_light_on = CASE_LIGHT_DEFAULT_ON;
29 29
     
30 30
 #ifndef INVERT_CASE_LIGHT
@@ -33,7 +33,6 @@ bool case_light_on = CASE_LIGHT_DEFAULT_ON;
33 33
 
34 34
 void update_case_light() {
35 35
   SET_OUTPUT(CASE_LIGHT_PIN);
36
-  uint8_t case_light_bright = (uint8_t)case_light_brightness;
37 36
   if (case_light_on) {
38 37
     if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
39 38
       analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );

+ 1
- 1
Marlin/src/feature/caselight.h Datei anzeigen

@@ -23,7 +23,7 @@
23 23
 #ifndef __CASELIGHT_H__
24 24
 #define __CASELIGHT_H__
25 25
 
26
-extern int case_light_brightness;  // LCD routine wants INT
26
+extern uint8_t case_light_brightness;
27 27
 extern bool case_light_on;
28 28
 
29 29
 void update_case_light();

+ 2
- 4
Marlin/src/lcd/ultralcd.cpp Datei anzeigen

@@ -761,9 +761,7 @@ void kill_screen(const char* lcd_msg) {
761 761
 
762 762
   #if ENABLED(MENU_ITEM_CASE_LIGHT)
763 763
 
764
-    extern int case_light_brightness;
765
-    extern bool case_light_on;
766
-    extern void update_case_light();
764
+    #include "../feature/caselight.h"
767 765
 
768 766
     void case_light_menu() {
769 767
       START_MENU();
@@ -771,7 +769,7 @@ void kill_screen(const char* lcd_msg) {
771 769
       // ^ Main
772 770
       //
773 771
       MENU_BACK(MSG_MAIN);
774
-      MENU_ITEM_EDIT_CALLBACK(int3, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
772
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true);
775 773
       MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
776 774
       END_MENU();
777 775
     }

Laden…
Abbrechen
Speichern