Wait before turning off PRINTER_EVENT_LEDS at print end (#10248)

This commit is contained in:
Scott Lahteine
2018-03-28 22:59:28 -05:00
committed by GitHub
parent 568ae094f4
commit 9e4c037cef
3 changed files with 27 additions and 4 deletions

View File

@ -33,6 +33,11 @@
#include "../../sd/cardreader.h"
#if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT)
bool GcodeSuite::lights_off_after_print;
#include "../../feature/leds/leds.h"
#endif
/**
* M0: Unconditional stop - Wait for user button press on LCD
* M1: Conditional stop - Wait for user button press on LCD
@ -91,6 +96,13 @@ void GcodeSuite::M0_M1() {
#endif
}
#if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT)
if (lights_off_after_print) {
leds.set_off();
lights_off_after_print = false;
}
#endif
wait_for_user = false;
KEEPALIVE_STATE(IN_HANDLER);
}