Skip to content

Commit

Permalink
Fix case light off
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored Nov 2, 2017
1 parent fd8f433 commit f7133e5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Marlin/src/feature/caselight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ void update_case_light() {
case_light_brightness = case_light_brightness_sav; // restore last brightens if this is an S1 arguement

if (case_light_on) {
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness );
}
else WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH);
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 - case_light_brightness : case_light_brightness);
else
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? LOW : HIGH);
}
else {
if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 : 0 ); // turn the light off
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
analogWrite(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? 255 : 0);
else
WRITE(CASE_LIGHT_PIN, INVERT_CASE_LIGHT ? HIGH : LOW);
}
}

Expand Down

0 comments on commit f7133e5

Please sign in to comment.