Limit Case Light PWM (#15459)

This commit is contained in:
Giuliano Zaro
2019-10-06 05:32:50 +02:00
committed by Scott Lahteine
parent f8498d8a52
commit a1ad01e4ab
107 changed files with 123 additions and 1 deletions

View File

@ -71,7 +71,13 @@ void update_case_light() {
#if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
if (PWM_PIN(CASE_LIGHT_PIN))
analogWrite(pin_t(CASE_LIGHT_PIN), n10ct);
analogWrite(pin_t(CASE_LIGHT_PIN),
#if CASE_LIGHT_MAX_PWM == 255
n10ct
#else
map(n10ct, 0, 255, 0, CASE_LIGHT_MAX_PWM)
#endif
);
else
#endif
{