Skip to content

Commit

Permalink
Fix heater freeze on power loss/reset (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagepc committed Jan 18, 2022
1 parent f2a5895 commit 8d86fc8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parts/boards/EinsyRambo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ namespace Boards
SetPin(Y_TMC2130_CS,1);
SetPin(Z_TMC2130_CS,1);
SetPin(E0_TMC2130_CS,1);

hExtruder.Reset();
}

}; // namespace Boards
4 changes: 4 additions & 0 deletions parts/components/Heater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ avr_cycle_count_t Heater::OnTempTick(avr_t * pAVR, avr_cycle_count_t)
return 0;
}

void Heater::Reset()
{
RegisterTimerUsec(m_fcnTempTick, 100000, this);
}

void Heater::OnPWMChanged(struct avr_irq_t *,uint32_t value)
{
Expand Down
3 changes: 3 additions & 0 deletions parts/components/Heater.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class Heater : public BasePeripheral, public Scriptable, public GLIndicator
// Change SoftPWM mode after creation
inline void SetSoftPWM(bool bVal) { m_bIsBed = bVal; }

// Reset heater
void Reset();

protected:
Scriptable::LineStatus ProcessAction (unsigned int iAct, const std::vector<std::string> &vArgs) override;

Expand Down

0 comments on commit 8d86fc8

Please sign in to comment.