Commit Graph

2194 Commits

Author SHA1 Message Date
Kevin O'Connor 64214255da test: Flush moves in quad_gantry_level and z_tilt_adjust tests
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-12 15:36:32 -04:00
Kevin O'Connor c037d273f7 test: Add quad_gantry_level and z_tilt_adjust test cases
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-12 13:49:27 -04:00
Kevin O'Connor 82b58e46a7 temperature_fan: Remove executable flag from temperature_fan.py
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:30:48 -04:00
Kevin O'Connor b21a22d744 tmc: Move common TMC stepper driver code to new file tmc.py
Move common code from tmc2130.py to tmc.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:29:35 -04:00
Kevin O'Connor 10c0da9a6c tmc2130: Rework remaining config helpers to use mcu_tmc interface
Introduce TMCMicrostepHelper and TMCStealthchopHelper helper code that
uses the mcu_tmc interface.  Update the callers to use these new
helpers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 7f34264101 tmc2130: Move TMC virtual endstop code into a new TMCEndstopHelper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 35edc4d63c tmc2660: Move current setting code to its own helper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor b2729f38a6 tmc5160: Move current setting code to its own helper class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 110bbb3843 tmc2130: Move current setting code to its own helper class
Concentrate the current setting code into its own TMCCurrentHelper
class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6abe132cf0 tmc2130: Transmit register initialization during connect callback
Perform the register initialization directly from TMCCommandHelper and
perform it during the "connect" phase.  This unifies the register
setup for the TMC2130, TMC2208, TMC2660, and TMC5160.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6947548c17 tmc2660: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor c76428bd01 tmc5160: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 1bdd51d575 tmc2208: Use TMCCommandHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 395c845ca1 tmc2130: Factor out g-code command handlers to their own class
Create a TMCCommandHelper class that implements INIT_TMC,
SET_TMC_FIELD, and DUMP_TMC.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 6a7ddb6bf0 tmc2208: Move get/set_register functions to new MCU_TMC_uart class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor ab710cd4de tmc2660: Move get/set_register functions to new MCU_TMC2660_SPI class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor a122d113e8 tmc5160: Use tmc2130.MCU_TMC_SPI for low-level get/set_register access
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 3becc6cf54 tmc2130: Move low-level get/set_register functions to new MCU_TMC_SPI class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 9ce98fd769 tmc2660: Define get_register() method
Use a get_register() method instead of get_response().  This makes the
tmc2660 class more similar to other TMC drivers.  It also enables
DUMP_TMC to dump all the readable content.

Also, use the tmc2130.get_config_microsteps() helper.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 2b0251ee99 tmc5160: Rename registers to Registers and fields to Fields
Minor change to the code so that it is more similar to the other tmc
drivers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 5de9f74525 test: Add test cases for tmc drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-10 14:18:58 -04:00
Kevin O'Connor 700e35c6ac armcm_timer: Unify udelay() implementation
Move the udelay() code from various arm board directories into the
src/generic/armcm_timer.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 20:27:57 -04:00
Kevin O'Connor 97840f9851 serialhdl: Use reactor mutex in send_with_response()
Reduce the delay in send_with_response() by introducing a reactor
mutex to wake the main thread when the response is obtained.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 19:12:24 -04:00
Kevin O'Connor 30d2ae8f9f gcode: Eliminate the process_batch() method
Allow the callers of process_batch() to directly inspect the gcode
mutex.  Those callers can then directly invoke run_script().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor 962f7b98bd gcode: Convert input handling to use a reactor mutex
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor afc10400e3 reactor: Be explicit on which handlers are timer_handler vs file_handler
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 18:44:44 -04:00
Kevin O'Connor 0546c18d27 reactor: Add support for mutexes
Add a mutex object that implements simple queing mutual exclusion for
greenlets.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 12:55:56 -04:00
Kevin O'Connor 61fc57e659 toolhead: Commands should still pause even when sync_print_time
If commands are slowly fed to the printer it could cause the number of
queued commands to grow without bound.  Be sure to pause the incoming
command stream even if the lookahead queue is empty.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 12:35:54 -04:00
Kevin O'Connor d7754a8f93 homing_override: Pass params to template evaluation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-09 11:14:31 -04:00
Kevin O'Connor 8b00580884 gcode_macro: Parse variable_X parameters using ast.literal_eval()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 19:33:31 -04:00
Kevin O'Connor 01f3b50e73 idle_timeout: Fix typo causing get_status() to fail
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 12:30:42 -04:00
Kevin O'Connor 9d33ef4061 config: Update example-extras.cfg to point to Command_Templates.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:57:54 -04:00
Kevin O'Connor f1c6d04376 filament_switch_sensor: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor d0be48da74 filament_runout_sensor: Auto load pause_resume module if pause_on_runout enabled
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor 3f4190c792 idle_timeout: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor e60ee861f8 extruder: Use template evaluation on gcode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 11:38:43 -04:00
Kevin O'Connor 27ca159285 gcode_macro: Add a default parameter to load_template
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 10:51:57 -04:00
Kevin O'Connor 9613cd2c8a config: Fix G90 use in sample-probe-as-z-endstop.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-07 10:37:10 -04:00
Kevin O'Connor cacb6f4378 klippy: Provide global access to a printer.command_error exception class
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:22:14 -04:00
Kevin O'Connor a541c2f60e docs: Update Config_Changes.md with "samples" move to probe config section
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:15:47 -04:00
Kevin O'Connor 49a3083d6a manual_probe: Add extra checks to catch manual probe not finishing correctly
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 40f73dd7f4 probe: Check for toolhead movement during activate/deactivate_gcode scripts
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor df80d96ae6 manual_probe: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor b8c7eb40c5 bed_screws: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 1fd490ddf9 probe: No need to re-raise an EndstopError
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 67964e71f1 homing: Catch the more generic CommandError during homing
Allow the low-level homing code to raise either a gcode.error or an
EndstopError during a fault.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor e9935e1a41 gcode: No need to re-raise an EndstopError
Now that EndstopError and gcode.error use the same underlying
Exception object, it is no longer necessary to translate an error.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 945a84c0ea gcode: Use the same underlying error object for homing and gcode errors
Introduce a homing.CommandError and use that as the basis for both
gcode and EndstopError exceptions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 97adca18c4 docs: Update Delta_Calibrate.md with probe location bias info
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor e061029b3a docs: Update Probe_Calibrate.md with information on common probe errors
Add a section describing PROBE_ACCURACY, describing probe location
bias, and describing probe temperature bias.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00