diff --git a/config/CreatBot_P800/1.0/door_detect.cfg b/config/CreatBot_P800/1.0/door_detect.cfg new file mode 100644 index 000000000..7f384b926 --- /dev/null +++ b/config/CreatBot_P800/1.0/door_detect.cfg @@ -0,0 +1 @@ +../../module/door_detect.cfg \ No newline at end of file diff --git a/config/CreatBot_P800/base.cfg b/config/CreatBot_P800/base.cfg index bb309622f..313685843 100644 --- a/config/CreatBot_P800/base.cfg +++ b/config/CreatBot_P800/base.cfg @@ -10,6 +10,10 @@ filename: ~/printer_data/config/config_variables.cfg [exclude_object] +[board_pins] +aliases: + DOOR_PIN=PE7 + [gcode_arcs] resolution: 1.0 @@ -193,6 +197,7 @@ off_below: 0.10 [filament_airpump_sensor extruder] switch_pin: !PE13 airpump_pin: PE2 +motor_pin: PE4 pause_on_runout: False runout_gcode: _RUNOUT_HANDLE max_run_time: 30 @@ -698,4 +703,4 @@ gcode: RESPOND TYPE=command MSG="action:prompt_end" _CLEAR_LAST_FILE -[include module/*.cfg] +[include module/*.cfg] \ No newline at end of file diff --git a/klippy/extras/filament_airpump_sensor.py b/klippy/extras/filament_airpump_sensor.py index 4cb2d6ed4..3558deead 100644 --- a/klippy/extras/filament_airpump_sensor.py +++ b/klippy/extras/filament_airpump_sensor.py @@ -25,6 +25,11 @@ class AirPump: self.airpump_mcu = self.airpump_pin.get_mcu() self.timeout_event_handler = timeout_event_handler + self.motor_pin = None + motor_pin = config.get('motor_pin') + self.motor_pin = ppins.setup_pin('digital_out', motor_pin) + self.motor_pin.setup_max_duration(0.) + def set_power(self, power, eventtime): print_time = self.airpump_mcu.estimated_print_time(eventtime + 0.1) logging.info(f"set air pump to {power} at {print_time}") @@ -34,6 +39,7 @@ class AirPump: self.is_running = True self.timeout_timer = self.reactor.register_timer( self._check_timeout, self.start_time + self.max_run_time) + self.motor_pin.set_digital(print_time, 1) self.airpump_pin.set_digital(print_time, 1) else: if self.timeout_timer is not None: @@ -41,6 +47,7 @@ class AirPump: self.timeout_timer = None self.is_running = False self.start_time = None + self.motor_pin.set_digital(print_time, 0) self.airpump_pin.set_digital(print_time, 0) def _check_timeout(self, eventtime):