aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
Commit message (Collapse)AuthorAgeFilesLines
...
* gcode: Add support for CLEAR_SHUTDOWN commandKevin O'Connor2016-12-011-1/+5
| | | | | | Add ability to clear the MCU shutdown flag from the console. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Detect if the communication channel to the firmware is lostKevin O'Connor2016-11-301-4/+18
| | | | | | Detect a comms loss and report it to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Throw an exception if any required config parameter is missingKevin O'Connor2016-11-301-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Raise a config error on an invalid pin name in the config fileKevin O'Connor2016-11-301-2/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Improve error reporting during connectKevin O'Connor2016-11-301-3/+2
| | | | | | | Catch exceptions during the connect phase and report them via the gcode interface to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Support reading from gcode input before mcu is readyKevin O'Connor2016-11-301-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Be careful to free memory allocated in C codeKevin O'Connor2016-11-301-2/+8
| | | | | | Free steppersync, stepcompress, and commandqueue objects. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Make SerialReader.send_with_response() blockingKevin O'Connor2016-11-291-35/+18
| | | | | | | Use the greenlet mechanism to wait for the response directly in the send_with_response() method. This simplifies the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Make SerialReader.connect() blockingKevin O'Connor2016-11-291-10/+2
| | | | | | | Use the greenlet mechanism to wait for the connection to come up in the serial connect() method. This simplifies the calling code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: Run the MCU connect code within the reactorKevin O'Connor2016-11-291-9/+11
| | | | | | | | Setup the reactor and run the MCU connection code as a timer within the reactor. The connection code will make use of reactor greenlets so that it can wait for events during the connection phase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Rename output_file_mode variable to is_fileoutputKevin O'Connor2016-11-291-3/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* klippy: No need to define __str__ and __init__ methods on exception classesKevin O'Connor2016-11-291-7/+4
| | | | | | The base Exception class already defines these methods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Handle adc initialization entirely in mcu codeKevin O'Connor2016-11-291-4/+12
| | | | | | | | Don't expose the ADC initialization to the gcode and heater code - instead, register a callback within the MCU_adc class and call it directly from the MCU class after configuration completes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Track the stepper position in the MCU in the MCU_stepper classKevin O'Connor2016-11-281-1/+11
| | | | | | | Support tracking of both the commanded_position and the mcu_position in the MCU_stepper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Store the stepper position in the mcu_stepper classKevin O'Connor2016-11-191-4/+19
| | | | | | | Move the storage of the stepper location from the kinematic classes to the low-level mcu_stepper class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Check for timeout during homing operationKevin O'Connor2016-11-181-3/+19
| | | | | | | | Should a homing move complete without hitting the endstop, then disable motors, disable the endstop checking, and report the error to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Create QueryEndstops class from gcodeKevin O'Connor2016-11-181-2/+3
| | | | | | | | | | | Create the QueryEndstops in the gcode handler instead of in the kinematic classes. This simplifies the gcode handler as it can directly register its response callback. Also, store the stepper name in the stepper class. Also, propagate the print_time of the query request to the mcu_endstop class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Remove support for DummyMCU classKevin O'Connor2016-11-161-87/+0
| | | | | | | It's easier to test with the file output mechanism and the DummyMCU code has grown stale. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Reset the next step time on a stepper stopKevin O'Connor2016-11-141-7/+3
| | | | | | | | | Automatically reset the next step time to zero on a stepper_stop() call. This makes the host code simpler as it no longer needs to schedule an explicit reset_step_clock command on the step after a homing operation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* delta: Initial support for linear delta kinematicsKevin O'Connor2016-11-141-0/+13
| | | | | | This adds support for delta based robots. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Do all step rounding in C codeKevin O'Connor2016-11-131-16/+12
| | | | | | | | | | | | | | | | | Commits f0cefebf and 8f331f08 changed the way the code determined what steps to take on fractional steps. Unfortunately, it was possible in some situations for the C code to round differently from the python code which could result in warnings and lost steps. Change the code so that all fractional step handling is done in the C code. Implementing the step rounding logic in one location avoids any conflicts. In order to efficiently handle the step rounding in the C code, the C code has also been extended to directly send the "set_next_step_dir" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Do not invert the direction of pullup pins by defaultKevin O'Connor2016-11-081-2/+2
| | | | | | | | | | A pullup setting on an input pin (ie, '^') should enable the hardware pullup resistor, but it should not invert the trigger level (ie, it should remain trigger on high). Those that need to change the trigger level (ie, trigger on low) must now do that explicitly (ie, '^!'). This makes the code match what other firmwares do. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Remove python checks for stepcompress integer overflowKevin O'Connor2016-11-021-6/+3
| | | | | | | Now that the C code checks for overflow, it is no longer necessary for the python code to check. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Fix endstop query timeout checkingKevin O'Connor2016-10-111-6/+10
| | | | | | | | | | Commit 0685802c changed the query endstop timeout to use host time instead of the mcu clock. However, it is possible for an endstop homing request to be in the future which makes using the host time inappropriate. Revert back to using the mcu clock to determine when to send an endstop query. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Support querying the current status of endstopsKevin O'Connor2016-09-221-15/+21
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Force a firmware shutdown on an unhandled exceptionKevin O'Connor2016-09-221-0/+6
| | | | | | | Check for unhandled exceptions and force the MCU to shutdown in that case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Write initial config commands when in file output modeKevin O'Connor2016-09-101-2/+4
| | | | | | | When doing serial file output debugging, write the config commands as they are often useful to inspect. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Consistently use mcu_freq variable name (instead of clock_freq)Kevin O'Connor2016-08-251-13/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Internally store _print_start_time instead of _print_start_clockKevin O'Connor2016-08-251-9/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: convert stepper, endstop, and digital_out to take mcu_timeKevin O'Connor2016-08-241-35/+36
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Convert PWM and ADC objects to take mcu_time instead of clockKevin O'Connor2016-08-241-24/+29
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support stepper phase adjustments when homingKevin O'Connor2016-07-281-0/+8
| | | | | | | Add support for enhancing the precision of endstop switches by also inspecting the phase of the stepper motor when the endstop triggers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+510
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>