diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-11-22 12:37:37 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-29 18:21:56 -0500 |
commit | d161d667412c9a096a52b1e0b156c49158d857d3 (patch) | |
tree | ab74b19ad6df3f94617bb2fa3a74c28d61dd37aa /klippy/heater.py | |
parent | 9755182adfa09de6886a0b482aa03d236f75f3ce (diff) | |
download | kutter-d161d667412c9a096a52b1e0b156c49158d857d3.tar.gz kutter-d161d667412c9a096a52b1e0b156c49158d857d3.tar.xz kutter-d161d667412c9a096a52b1e0b156c49158d857d3.zip |
mcu: Handle adc initialization entirely in mcu code
Don't expose the ADC initialization to the gcode and heater code -
instead, register a callback within the MCU_adc class and call it
directly from the MCU class after configuration completes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/heater.py')
-rw-r--r-- | klippy/heater.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/klippy/heater.py b/klippy/heater.py index 06bc0cd1..b7987936 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -47,14 +47,12 @@ class PrinterHeater: max_adc = self.calc_adc(self.config.getfloat('min_temp')) self.mcu_adc.set_minmax( SAMPLE_TIME, SAMPLE_COUNT, minval=min_adc, maxval=max_adc) - self.mcu_adc.set_adc_callback(self.adc_callback) + self.mcu_adc.set_adc_callback(REPORT_TIME, self.adc_callback) control_algo = self.config.get('control', 'watermark') algos = {'watermark': ControlBangBang, 'pid': ControlPID} self.control = algos[control_algo](self, self.config) if self.printer.mcu.output_file_mode: self.can_extrude = True - def run(self): - self.mcu_adc.query_analog_in(REPORT_TIME) def set_pwm(self, read_time, value): if value: if self.target_temp <= 0.: |