From 03a46eab5670c2934b38093993834f822a56c0fe Mon Sep 17 00:00:00 2001 From: Julian Schill Date: Mon, 1 Jul 2024 22:26:20 +0200 Subject: [PATCH] rename setup_minmax to setup_adc_sample for analog effect. Fixes [BUG] 'MCU_adc' object has no attribute 'setup_minmax' #211 --- simulator/simulator/klippermock.py | 2 +- src/led_effect.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/simulator/simulator/klippermock.py b/simulator/simulator/klippermock.py index 6a5c539..9799d6b 100644 --- a/simulator/simulator/klippermock.py +++ b/simulator/simulator/klippermock.py @@ -64,7 +64,7 @@ def set_stepper_pos(self, pos): self.led_effect.handler.stepperPositions=[pos,pos,pos] def setup_pin(self, name, pin): return self - def setup_minmax(self, min, max): + def setup_adc_sample(self, min, max): pass def setup_adc_callback(self, time, adcCallback): pass diff --git a/src/led_effect.py b/src/led_effect.py index f67d85f..9f04c88 100644 --- a/src/led_effect.py +++ b/src/led_effect.py @@ -363,7 +363,7 @@ def __init__(self, config): if self.analogPin: ppins = self.printer.lookup_object('pins') self.mcu_adc = ppins.setup_pin('adc', self.analogPin) - self.mcu_adc.setup_minmax(ANALOG_SAMPLE_TIME, ANALOG_SAMPLE_COUNT) + self.mcu_adc.setup_adc_sample(ANALOG_SAMPLE_TIME, ANALOG_SAMPLE_COUNT) self.mcu_adc.setup_adc_callback(ANALOG_REPORT_TIME, self.adcCallback) query_adc = self.printer.load_object(self.config, 'query_adc') query_adc.register_adc(self.name, self.mcu_adc)