From f3e502c1ef15ec20b9fe962e5b22fee9dfb99999 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 17 Dec 2012 16:38:21 +0100 Subject: [PATCH] Fix auto-idle. Powering on even with a heater set to zero doesn't work, as temperature driven heaters are set to zero all the time. So, the PSU was running all the time. The bug was introduced with 569e3d504aafd1ffc8b279b5d7092970cef72287 --- clock.c | 2 -- heater.c | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/clock.c b/clock.c index 25b20a4..005129f 100644 --- a/clock.c +++ b/clock.c @@ -22,7 +22,6 @@ called from clock_10ms(), do not call directly */ static void clock_250ms(void) { - #ifndef NO_AUTO_IDLE if (heaters_all_zero()) { if (psu_timeout > (30 * 4)) { power_off(); @@ -36,7 +35,6 @@ static void clock_250ms(void) { SREG = save_reg; } } - #endif ifclock(clock_flag_1s) { if (DEBUG_POSITION && (debug_flags & DEBUG_POSITION)) { diff --git a/heater.c b/heater.c index 60322e2..199aaed 100644 --- a/heater.c +++ b/heater.c @@ -438,9 +438,8 @@ void heater_set(heater_t index, uint8_t value) { *(heaters[index].heater_port) &= ~MASK(heaters[index].heater_pin); } - // Do this even when the heater is set to - // zero to deal with long cool down phases. - power_on(); + if (value) + power_on(); } /** \brief check wether all heaters are off