Skip to content

Commit

Permalink
🐛 Fix hotend idle timeout checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and EvilGremlin committed Oct 26, 2023
1 parent 449ac95 commit b3ada7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/feature/hotend_idle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ void HotendIdleProtection::check_hotends(const millis_t &ms) {
if (!do_prot)
next_protect_ms = 0; // No hotends are hot so cancel timeout
else if (!next_protect_ms) // Timeout is possible?
next_protect_ms = ms + cfg.timeout * 1000; // Start timeout if not already set
next_protect_ms = ms + 1000UL * cfg.timeout; // Start timeout if not already set
}

void HotendIdleProtection::check_e_motion(const millis_t &ms) {
static float old_e_position = 0;
if (old_e_position != current_position.e) {
old_e_position = current_position.e; // Track filament motion
if (next_protect_ms) // If some heater is on then...
next_protect_ms = ms + cfg.timeout * 1000; // ...delay the timeout till later
old_e_position = current_position.e; // Track filament motion
if (next_protect_ms) // If some heater is on then...
next_protect_ms = ms + 1000UL * cfg.timeout; // ...delay the timeout till later
}
}

Expand Down

0 comments on commit b3ada7a

Please sign in to comment.