Browse Source

Patch for caselight + lcd compile issues

Scott Lahteine 7 years ago
parent
commit
bfd1e75c04

+ 1
- 2
Marlin/src/feature/caselight.cpp View File

24
 
24
 
25
 #if HAS_CASE_LIGHT
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
 bool case_light_on = CASE_LIGHT_DEFAULT_ON;
28
 bool case_light_on = CASE_LIGHT_DEFAULT_ON;
29
     
29
     
30
 #ifndef INVERT_CASE_LIGHT
30
 #ifndef INVERT_CASE_LIGHT
33
 
33
 
34
 void update_case_light() {
34
 void update_case_light() {
35
   SET_OUTPUT(CASE_LIGHT_PIN);
35
   SET_OUTPUT(CASE_LIGHT_PIN);
36
-  uint8_t case_light_bright = (uint8_t)case_light_brightness;
37
   if (case_light_on) {
36
   if (case_light_on) {
38
     if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
37
     if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
39
       analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );
38
       analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );

+ 1
- 1
Marlin/src/feature/caselight.h View File

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

+ 2
- 4
Marlin/src/lcd/ultralcd.cpp View File

761
 
761
 
762
   #if ENABLED(MENU_ITEM_CASE_LIGHT)
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
     void case_light_menu() {
766
     void case_light_menu() {
769
       START_MENU();
767
       START_MENU();
771
       // ^ Main
769
       // ^ Main
772
       //
770
       //
773
       MENU_BACK(MSG_MAIN);
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
       MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
773
       MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light);
776
       END_MENU();
774
       END_MENU();
777
     }
775
     }

Loading…
Cancel
Save