mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-15 12:49:55 +01:00
output_pin: Rename "delay" flag to "repeat" in GCodeRequestQueue()
Rename the flag to make it more clear what it does. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -63,7 +63,7 @@ class Fan:
|
||||
self.last_req_value = value
|
||||
self.last_fan_value = self.max_power
|
||||
self.mcu_fan.set_pwm(print_time, self.max_power)
|
||||
return "delay", self.kick_start_time
|
||||
return "repeat", print_time + self.kick_start_time
|
||||
self.last_fan_value = self.last_req_value = value
|
||||
self.mcu_fan.set_pwm(print_time, value)
|
||||
def set_speed(self, value, print_time=None):
|
||||
|
||||
@@ -38,23 +38,23 @@ class GCodeRequestQueue:
|
||||
pos += 1
|
||||
req_pt, req_val = rqueue[pos]
|
||||
# Invoke callback for the request
|
||||
min_wait = 0.
|
||||
ret = self.callback(next_time, req_val)
|
||||
if ret is not None:
|
||||
# Handle special cases
|
||||
action, min_wait = ret
|
||||
action, next_min_time = ret
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
next_min_time)
|
||||
if action == "discard":
|
||||
del rqueue[:pos+1]
|
||||
continue
|
||||
if action == "reschedule":
|
||||
del rqueue[:pos]
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
min_wait)
|
||||
continue
|
||||
if action == "delay":
|
||||
if action == "repeat":
|
||||
pos -= 1
|
||||
del rqueue[:pos+1]
|
||||
self.next_min_flush_time = next_time + max(min_wait, min_sched_time)
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
next_time + min_sched_time)
|
||||
# Ensure following queue items are flushed
|
||||
self.motion_queuing.note_mcu_movequeue_activity(
|
||||
self.next_min_flush_time, is_step_gen=False)
|
||||
@@ -73,19 +73,20 @@ class GCodeRequestQueue:
|
||||
while 1:
|
||||
next_time = max(print_time, self.next_min_flush_time)
|
||||
# Invoke callback for the request
|
||||
action, min_wait = "normal", 0.
|
||||
action, next_min_time = "normal", 0.
|
||||
ret = self.callback(next_time, value)
|
||||
if ret is not None:
|
||||
# Handle special cases
|
||||
action, min_wait = ret
|
||||
action, next_min_time = ret
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
next_min_time)
|
||||
if action == "discard":
|
||||
break
|
||||
if action == "reschedule":
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
min_wait)
|
||||
continue
|
||||
self.next_min_flush_time = next_time + max(min_wait, min_sched_time)
|
||||
if action != "delay":
|
||||
self.next_min_flush_time = max(self.next_min_flush_time,
|
||||
next_time + min_sched_time)
|
||||
if action != "repeat":
|
||||
break
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user