mirror of https://github.com/Desuuuu/klipper.git
mcu: Use is_fileoutput() externally
Use mcu.is_fileoutput() instead of looking up the "debugoutput" flag in the start args. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f1c2f789b6
commit
b9586bad18
|
@ -113,8 +113,6 @@ class PrinterHeater:
|
||||||
self.min_extrude_temp = config.getfloat(
|
self.min_extrude_temp = config.getfloat(
|
||||||
'min_extrude_temp', 170., minval=self.min_temp, maxval=self.max_temp)
|
'min_extrude_temp', 170., minval=self.min_temp, maxval=self.max_temp)
|
||||||
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
|
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
|
||||||
is_fileoutput = printer.get_start_args().get('debugoutput') is not None
|
|
||||||
self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput
|
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.last_temp = 0.
|
self.last_temp = 0.
|
||||||
self.last_temp_time = 0.
|
self.last_temp_time = 0.
|
||||||
|
@ -134,6 +132,8 @@ class PrinterHeater:
|
||||||
self.mcu_adc.setup_minmax(SAMPLE_TIME, SAMPLE_COUNT,
|
self.mcu_adc.setup_minmax(SAMPLE_TIME, SAMPLE_COUNT,
|
||||||
minval=min(adc_range), maxval=max(adc_range))
|
minval=min(adc_range), maxval=max(adc_range))
|
||||||
self.mcu_adc.setup_adc_callback(REPORT_TIME, self.adc_callback)
|
self.mcu_adc.setup_adc_callback(REPORT_TIME, self.adc_callback)
|
||||||
|
is_fileoutput = self.mcu_adc.get_mcu().is_fileoutput()
|
||||||
|
self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput
|
||||||
self.control = algo(self, config)
|
self.control = algo(self, config)
|
||||||
# pwm caching
|
# pwm caching
|
||||||
self.next_pwm_time = 0.
|
self.next_pwm_time = 0.
|
||||||
|
|
|
@ -95,7 +95,7 @@ class PrinterHomingStepper(PrinterStepper):
|
||||||
logging.info("Endstop for %s is not accurate enough for stepper"
|
logging.info("Endstop for %s is not accurate enough for stepper"
|
||||||
" phase adjustment" % (name,))
|
" phase adjustment" % (name,))
|
||||||
self.homing_stepper_phases = None
|
self.homing_stepper_phases = None
|
||||||
if printer.get_start_args().get('debugoutput') is not None:
|
if self.mcu_endstop.get_mcu().is_fileoutput():
|
||||||
self.homing_endstop_accuracy = self.homing_stepper_phases
|
self.homing_endstop_accuracy = self.homing_stepper_phases
|
||||||
def enable_endstop_checking(self, move_time, step_time):
|
def enable_endstop_checking(self, move_time, step_time):
|
||||||
mcu_time = self.mcu_endstop.get_mcu().print_to_mcu_time(move_time)
|
mcu_time = self.mcu_endstop.get_mcu().print_to_mcu_time(move_time)
|
||||||
|
|
|
@ -356,7 +356,7 @@ class ToolHead:
|
||||||
logging.debug('; Max time of %f' % (last_move_time,))
|
logging.debug('; Max time of %f' % (last_move_time,))
|
||||||
def wait_moves(self):
|
def wait_moves(self):
|
||||||
self._flush_lookahead()
|
self._flush_lookahead()
|
||||||
if self.printer.get_start_args().get('debugoutput') is not None:
|
if self.mcu.is_fileoutput():
|
||||||
return
|
return
|
||||||
eventtime = self.reactor.monotonic()
|
eventtime = self.reactor.monotonic()
|
||||||
while self.print_time:
|
while self.print_time:
|
||||||
|
|
Loading…
Reference in New Issue