Fysetc Cheetah v1.2 boards require a special sequence to reset reliably.
This sequence works for me in all cases. Simpler sequences without
double reset did not work correctly. This is likely because of a weird
stateful circuitry for toggling the bootloader state.
Cheetah boards use RTS to configure bootloader triggering. By default,
pySerial sets RTS on connect, which unfortunately configures the board
to start the bootloader on reset.
Add a toggle for the RTS state to allow users to workaround. The RTS state
is set before the serial connection is opened, so there are no glitches.
Addresses #2026.
Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
Use new mcu.lookup_query_command() for all commands that query
information from the micro-controller.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert standard queries to use the acknowledgments of the sent
command to determine if the response was received or not. This also
controls command retransmissions (should the response have been lost).
The tmc_uart.py will continue to use the old mechanism as the tmcuart
responses are not sent synchronously with the query command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change home_wait() to return if the homing operation completed
succesfully or not. This simplifies the callers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Update the endstop code to return its trigger completion object during
home_start(). Update the toolhead class to take a completion object
(instead of creating its own). This reduces the number of
intermediate callbacks needed during a homing operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Collapse the "homing:move_begin", "homing:move_end", home_prepare(),
and home_finalize() into two new events: "homing:homing_move_begin"
and "homing:homing_move_end". This simplifies the homing code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Eliminate the old gen_steps() call now that all callers have been
converted to the newer trapq based generate_steps().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Support associating a stepper_kinematics with a trapq. Support
generating steps from a time range on the given trapq.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Break up the connect phase into two phases - mcu_identify and connect.
The first phase will contact all the micro-controllers and obtain the
"identify" data dictionaries for them. Once all the micro-controllers
have been contacted, then they can be configured. This fixes an issue
with FIRMWARE_RESTART not working correctly on multi-mcu setups that
use restart_method=command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rename the commands.
The main reason for this change is to force a micro-controller code
updated (due to important bugfix in 7fefe52d).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that homing is implemented via "drip moves", it is no longer
necessary for the stepcompress code to have special homing logic.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Rework the low-level implementation of homing movement. The existing
mechanism buffers all homing movement into the micro-controller prior
to starting the home. Replace with a system that buffers all movement
into the host look-ahead buffer and then "drip feed" those moves to
the micro-controllers. Then clear the host look-ahead buffer when all
endstops trigger.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Move the serial command wrapper class from serialhdl.py to mcu.py.
This will allow that class to better support higher level
functionality.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Improve the precision of soft pwm pulses by allowing the host to
directly specify the clock duration of the pulse. This improvement in
precision may be noticeable when controller servos (and bltouch).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that enumerations are available, any variable named "pin" can only
be used to describe a gpio pin. Rename the end_stop_state "pin"
parameter to "pin_value". Also, rename "end_stop_query" command to
"end_stop_query_state" to notify users to upgrade both host and mcu
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Query the bltouch state during the pin_up command to try and verify
that the probe does actually retract. This may be useful to detect if
the bltouch enters into an "error" state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Make sure to not query the given endstop until after the start of the
requested operation. This ensures that the operation has started
prior to querying the status of that operation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("connect") handler to register
a "klippy:connect" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("disconnect") handler to
register a "klippy:disconnect" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert all users of the printer_state("shutdown") handler to register
a "klippy:shutdown" event handler instead.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Log the details of the MCU prior to attempting to configure the MCU.
This way, the log contains the MCU information even if a configuration
error occurs.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Change the name of the config registration method and pass an explicit
reference to the callback to the new method. This makes the
relationship between mcu registration and build_config() more clear in
the calling code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>