Laser Safety Timeout (#24189)

This commit is contained in:
John Robertson
2022-05-31 23:09:44 +01:00
committed by GitHub
parent 6f3d7d864f
commit 85c0875db2
14 changed files with 105 additions and 41 deletions

View File

@@ -396,14 +396,20 @@ public:
static bool select_coordinate_system(const int8_t _new);
#endif
static millis_t previous_move_ms, max_inactive_time, stepper_inactive_time;
FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; }
static millis_t previous_move_ms, max_inactive_time;
FORCE_INLINE static bool stepper_max_timed_out(const millis_t ms=millis()) {
return max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time);
}
FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) {
return ELAPSED(ms, previous_move_ms + stepper_inactive_time);
}
FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; }
#if HAS_DISABLE_INACTIVE_AXIS
static millis_t stepper_inactive_time;
FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) {
return ELAPSED(ms, previous_move_ms + stepper_inactive_time);
}
#else
static bool stepper_inactive_timeout(const millis_t) { return false; }
#endif
static void report_echo_start(const bool forReplay);
static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true);