Add a global machine state

This commit is contained in:
Scott Lahteine
2020-03-14 18:47:44 -05:00
parent 41ffe9851d
commit 095a1123c1
4 changed files with 21 additions and 9 deletions

View File

@@ -202,7 +202,7 @@ const char NUL_STR[] PROGMEM = "",
SP_Z_LBL[] PROGMEM = " Z:",
SP_E_LBL[] PROGMEM = " E:";
bool Running = true;
MarlinState marlin_state = MF_INITIALIZING;
// For M109 and M190, this flag may be cleared (by M108) to exit the wait loop
bool wait_for_heatup = true;
@@ -839,7 +839,7 @@ void stop() {
SERIAL_ERROR_MSG(STR_ERR_STOPPED);
LCD_MESSAGEPGM(MSG_STOPPED);
safe_delay(350); // allow enough time for messages to get out before stopping
Running = false;
marlin_state = MF_STOPPED;
}
}
@@ -1183,6 +1183,8 @@ void setup() {
SETUP_RUN(max7219.init());
#endif
marlin_state = MF_RUNNING;
SETUP_LOG("setup() completed.");
}