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

@@ -76,9 +76,19 @@ void minkill(const bool steppers_off=false);
void quickstop_stepper();
extern bool Running;
inline bool IsRunning() { return Running; }
inline bool IsStopped() { return !Running; }
// Global State of the firmware
enum MarlinState : uint8_t {
MF_INITIALIZING = 0,
MF_RUNNING = _BV(0),
MF_PAUSED = _BV(1),
MF_WAITING = _BV(2),
MF_STOPPED = _BV(3),
MF_KILLED = _BV(7)
};
extern MarlinState marlin_state;
inline bool IsRunning() { return marlin_state == MF_RUNNING; }
inline bool IsStopped() { return marlin_state != MF_RUNNING; }
bool printingIsActive();
bool printingIsPaused();