Commit Graph

2324 Commits

Author SHA1 Message Date
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
Kevin O'Connor 15011012e5 probe: Simplify ProbePointsHelper start and end tracking
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor bbc8637ed6 probe: Be sure to call gcode.reset_last_position() after any manual move
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 74cc005ff3 probe: Unify mean and median code between run_probe() and PROBE_ACCURACY
Factor out _calc_mean() and _calc_median() functions and call from
both run_probe() and cmd_PROBE_ACCURACY().

This also fixes a subtle error in the run_probe() median function - on
some kinematics the x and y position can change on a z move so the x
and y should be taken from the z probe values actually used.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Kevin O'Connor 2b8dca5dbf probe: Move multi-sampling capability from ProbePointsHelper to Probe
This changes the config file so that the configuration of
multi-samples is now done in the [probe] (and [bltouch]) section
instead of the various delta, bed_mesh, z_tilt, etc. config sections.

With this change, PROBE and PROBE_CALIBRATE commands now also utilize
multi-sampling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-06 10:08:58 -04:00
Len Trigg 5989f7a8a6 firmware_retraction: Implementation of tuneable G10/G11 firmware retraction (#1617)
This supports getting and setting of retraction parameters without
having to restart klippy.

Signed-off-by: Len Trigg <lenbok@gmail.com>
2019-06-06 09:10:09 -04:00
Kevin O'Connor d065787afc gcode_macro: Add support "x in printer" to templates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 12:41:28 -04:00
Kevin O'Connor 1c09a0935f idle_timeout: Add a get_status() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 12:35:50 -04:00
Kevin O'Connor 0bb714edd7 menu: Remove customized get_status overrides
Now that the extruder, display, heater_fan, output_pin, and servo
classes have get_status() methods, it is no longer necessary to
override them in the menu code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:55:40 -04:00
Janar Sööt df765b33dc display: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 11:51:46 -04:00
Janar Sööt 9155886c21 extruder: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:57 -04:00
Janar Sööt 94f5fb3553 servo: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:50 -04:00
Janar Sööt efecc96427 output_pin: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:44:35 -04:00
Janar Sööt e519ab2031 heater_fan: add get_status method
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-06-04 11:43:34 -04:00
Kevin O'Connor 3f96c0abd8 docs: Minor wording change to Command_Templates.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 10:39:43 -04:00
Kevin O'Connor 962c48ecf7 docs: Fix github pages "liquid" rendering of Command_Templates.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 10:31:03 -04:00
Kevin O'Connor 94c1ad7241 docs: Add an initial Command_Templates.md document
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor 52e7e52119 test: Add a macros.test test case for testing gcode_macro
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor a68f577adf gcode_macro: Add support for SET_GCODE_VARIABLE command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor 6e88320d62 gcode: "gcode_position" and toolhead "position" as get_status() named tuple
Add "gcode_position" named tuple to gcode.get_status(). Add a
"position" named tuple to toolhead.get_status().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00
Kevin O'Connor 4ccc218b06 gcode: Add action_x() callables to get_status()
Add action_respond_info(), action_respond_error(), and
action_emergency_stop() callables to the get_status() return
dictionary.  This allows gcode macros to directly invoke these
actions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-06-04 09:50:30 -04:00