heater: Report last temperature in PWM debugging

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-01-10 12:28:42 -05:00
parent b2885a53cb
commit 4a71c7a2bd
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,9 @@ class PrinterHeater:
pwm_time = read_time + REPORT_TIME + SAMPLE_TIME*SAMPLE_COUNT
self.next_pwm_time = pwm_time + 0.75 * MAX_HEAT_TIME
self.last_pwm_value = value
logging.debug("pwm=%d@%.3f (%.3f)" % (value, read_time, pwm_time))
logging.debug("%s: pwm=%d@%.3f (from %.3f@%.3f)" % (
self.config.section, value, pwm_time,
self.last_temp, self.last_temp_time))
self.mcu_pwm.set_pwm(pwm_time, value)
# Temperature calculation
def calc_temp(self, adc):