Skip to content

Commit

Permalink
fix bug in safety timer while printing
Browse files Browse the repository at this point in the history
  • Loading branch information
RadekVana committed Feb 10, 2021
1 parent 8e340de commit 2b0a402
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/marlin_stubs/feature/safety_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ SafetyTimer::expired_t SafetyTimer::Loop() {
//timer is expired
if (pBoundPause) {
pBoundPause->NotifyExpiredFromSafetyTimer(thermalManager.degTargetHotend(0), thermalManager.degTargetBed());
if (printingIsPaused()) {
thermalManager.disable_hotend();
set_warning(WarningType::NozzleTimeout);
} else {
thermalManager.disable_all_heaters();
set_warning(WarningType::HeatersTimeout);
}
return expired_t::yes;
}
if (printingIsPaused()) {
last_reset = now;
Expand Down
6 changes: 4 additions & 2 deletions src/marlin_stubs/pause/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ Response PausePrivatePhase::getResponse() {

bool PausePrivatePhase::CanSafetyTimerExpire() const {
if (HasTempToRestore())
return false; // already expired
return ClientResponses::HasButton(getPhase()); // button in current phase == can wait on user == can timeout
return false; // already expired
if (getPhase() == PhasesLoadUnload::MakeSureInserted) // special waiting state without button
return true; // waits for filament sensor
return ClientResponses::HasButton(getPhase()); // button in current phase == can wait on user == can timeout
}

void PausePrivatePhase::NotifyExpiredFromSafetyTimer(float hotend_temp, float bed_temp) {
Expand Down

0 comments on commit 2b0a402

Please sign in to comment.