|
|
@ -49,14 +49,15 @@ void update_case_light() {
|
|
|
|
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 arguement
|
|
|
|
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 arguement
|
|
|
|
|
|
|
|
|
|
|
|
if (case_light_on) {
|
|
|
|
if (case_light_on) {
|
|
|
|
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
|
|
|
|
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
|
|
|
|
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness);
|
|
|
|
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH);
|
|
|
|
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
|
|
|
|
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
|
|
|
|
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 : 0 ); // turn the light off
|
|
|
|
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 : 0);
|
|
|
|
|
|
|
|
else
|
|
|
|
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
|
|
|
|
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|