diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-10-06 19:23:15 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-10-11 11:14:32 -0400 |
commit | 27249dc709f61c72f8d6223f8f29a4964f2b7a48 (patch) | |
tree | 5ef9ed70dad4c40a5b7714d81e7fb2d401711f06 /klippy/mcu.py | |
parent | d317793171a12bf02fd5e14c2428e1fc0cb3b438 (diff) | |
download | kutter-27249dc709f61c72f8d6223f8f29a4964f2b7a48.tar.gz kutter-27249dc709f61c72f8d6223f8f29a4964f2b7a48.tar.xz kutter-27249dc709f61c72f8d6223f8f29a4964f2b7a48.zip |
mcu: Increase the time to reset a pwm pin during startup
Some RPi0 users were reporting "timer too close" errors due to pwm pin
resets - increase the time the host has to complete the startup to
avoid this.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r-- | klippy/mcu.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index 8e819191..df49c927 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -196,6 +196,9 @@ class MCU_pwm: self._is_static = is_static def _build_config(self): cmd_queue = self._mcu.alloc_command_queue() + curtime = self._mcu.get_printer().get_reactor().monotonic() + printtime = self._mcu.estimated_print_time(curtime) + self._last_clock = self._mcu.print_time_to_clock(printtime + 0.200) cycle_ticks = self._mcu.seconds_to_clock(self._cycle_time) if self._hardware_pwm: self._pwm_max = self._mcu.get_constant_float("PWM_MAX") @@ -213,9 +216,6 @@ class MCU_pwm: self._start_value * self._pwm_max, self._shutdown_value * self._pwm_max, self._mcu.seconds_to_clock(self._max_duration))) - curtime = self._mcu.get_printer().get_reactor().monotonic() - printtime = self._mcu.estimated_print_time(curtime) - self._last_clock = self._mcu.print_time_to_clock(printtime + 0.100) svalue = int(self._start_value * self._pwm_max + 0.5) self._mcu.add_config_cmd("schedule_pwm_out oid=%d clock=%d value=%d" % (self._oid, self._last_clock, svalue), @@ -238,9 +238,6 @@ class MCU_pwm: % (self._oid, self._pin, self._start_value >= 1.0, self._shutdown_value >= 0.5, self._mcu.seconds_to_clock(self._max_duration))) - curtime = self._mcu.get_printer().get_reactor().monotonic() - printtime = self._mcu.estimated_print_time(curtime) - self._last_clock = self._mcu.print_time_to_clock(printtime + 0.100) svalue = int(self._start_value * self._pwm_max + 0.5) self._mcu.add_config_cmd( "schedule_soft_pwm_out oid=%d clock=%d on_ticks=%d off_ticks=%d" |