Browse Source

Fix unused var warning (#16467)

ManuelMcLure 4 years ago
parent
commit
675295692b
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      Marlin/src/feature/caselight.cpp

+ 5
- 3
Marlin/src/feature/caselight.cpp View File

58
   if (case_light_arg_flag && case_light_on)
58
   if (case_light_arg_flag && case_light_on)
59
     case_light_brightness = case_light_brightness_sav;  // restore last brightens if this is an S1 argument
59
     case_light_brightness = case_light_brightness_sav;  // restore last brightens if this is an S1 argument
60
 
60
 
61
-  const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
61
+  #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) || NONE(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_NO_BRIGHTNESS)
62
+    const uint8_t i = case_light_on ? case_light_brightness : 0, n10ct = INVERT_CASE_LIGHT ? 255 - i : i;
63
+  #endif
62
 
64
 
63
   #if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
65
   #if ENABLED(CASE_LIGHT_USE_NEOPIXEL)
64
 
66
 
71
 
73
 
72
     #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
74
     #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
73
       if (PWM_PIN(CASE_LIGHT_PIN))
75
       if (PWM_PIN(CASE_LIGHT_PIN))
74
-        analogWrite(pin_t(CASE_LIGHT_PIN),
76
+        analogWrite(pin_t(CASE_LIGHT_PIN), (
75
           #if CASE_LIGHT_MAX_PWM == 255
77
           #if CASE_LIGHT_MAX_PWM == 255
76
             n10ct
78
             n10ct
77
           #else
79
           #else
78
             map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM)
80
             map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM)
79
           #endif
81
           #endif
80
-        );
82
+        ));
81
       else
83
       else
82
     #endif
84
     #endif
83
       {
85
       {

Loading…
Cancel
Save