aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* build: Support creating and storing the data dictionary on each buildKevin O'Connor2016-09-102-4/+12
| | | | | | | Generate the data dictionary in out/klipper.dict on each build. This makes it easier to use the dictionary when debugging. 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-245-86/+79
| | | | 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-243-96/+85
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Update Installation.md - Arduino Due is also supportedKevin O'Connor2016-07-281-1/+2
| | | | | | | Update the document introduction to note that the Arduino Due is also now supported. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support stepper phase adjustments when homingKevin O'Connor2016-07-286-2/+81
| | | | | | | 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>
* extruder: Add some additional commentsKevin O'Connor2016-07-261-0/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: ARM updates for Code_Overview.mdKevin O'Connor2016-07-261-22/+35
| | | | | | | | Some details on the code flow and organization have changed since support for ARM processors was added. Update Code_Overview.md accordingly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* homing: Move low-level coordinate manipulation to kinematic classKevin O'Connor2016-07-254-64/+70
| | | | | | | Rework the code so that the kinematic class (currently just cartesian.py) has more control over the homing process. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gcode: Error on G20 (set units to inches) commandKevin O'Connor2016-07-251-3/+2
| | | | | | | Respond with an error to a G20 command (instead of effectively ignoring the command). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Add support for "pressure advance" on extrusionKevin O'Connor2016-07-253-39/+109
| | | | | | | | | Add a config option to define an amount of additional filament to feed into the extruder during acceleration and deceleration of the extruder. This can help ensure plastic is deposited in the correct places during a print. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Limit lookahead optimization to moves with similar extrude ratiosKevin O'Connor2016-07-221-3/+12
| | | | | | | | Only skip acceleration between moves if both moves perform a similar amount of extrusion. This ensures the extruder has sufficient time to accelerate to and from each extrude move. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Have caller calculate max jerk velocityKevin O'Connor2016-07-223-2/+9
| | | | | | | | | | Allow the owner of the stepper object to cacluate the maximum step jerk velocity. This is used to ensure there is no communication error between mcu and host. Disable checking of jerk velocity for extruder stepper motors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Add some comments to acceleration codeKevin O'Connor2016-07-161-6/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Calculate baudadjust from MCU's baud instead of host baudKevin O'Connor2016-07-165-15/+22
| | | | | | | Store the baud rate the MCU is configured for in the "identify" data and use that rate when calculating the baudadjust parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Fix error causing queue to not be expanded in expand_queue()Kevin O'Connor2016-07-161-2/+2
| | | | | | | | The test to check if the queue only needed to be moved was not correct and it could lead to a segfault if clean_queue() was called instead of actually increasing the queue size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Check for invalid count in step_factor and step_sqrtKevin O'Connor2016-07-161-2/+13
| | | | | | | Check for an invalid count and report an error if found. This prevents some segfaults when count goes negative. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* extruder: Create a new class and python file to track the printer extruderKevin O'Connor2016-07-108-27/+88
| | | | | | | | | Create a new python file (extruder.py) to control the extruder heater and stepper motors. This separates the extruder control logic from the cartesian robot code - making it easier to customize both the kinematic control of the robot as well as the extruder. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Store max_velocity/max_accel instead of max_step_velocity/accelKevin O'Connor2016-07-102-18/+11
| | | | | | | | All users of max_step_velocity and max_step_accel end up multiplying by step_dist anyway, so it's easier to store max_velocity and max_accel. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Avoid using a dummy_move for an empty move_queueKevin O'Connor2016-07-101-11/+3
| | | | | | | | | Explicitly check for when the move_queue is empty and only call move.calc_junction() when there is a previous move. This avoids the need to create a dummy "sentinal" move object and it simplifies the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Merge lookahead.py into toolhead.pyKevin O'Connor2016-07-102-53/+53
| | | | | | | | Remove the lookahead.py file and move its code directly into toolhead.py. The MoveQueue() class is small and tightly coupled to the toolhead code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* toolhead: Split toolhead code from cartesian.py to new file toolhead.pyKevin O'Connor2016-07-103-197/+205
| | | | | | Separate out the toolhead logic to its own python file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Separate out cartesian robot handling from ToolHead classKevin O'Connor2016-07-101-90/+112
| | | | | | | Separate out the low-level stepper motor kinematics handling from the ToolHead class into its own class. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Rename CartKinematics class to ToolHeadKevin O'Connor2016-07-104-40/+40
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* cartesian: Do acceleration and lookahead on requested coordinatesKevin O'Connor2016-07-101-51/+64
| | | | | | | | | Perform all acceleration calculations and lookahead checks in millimeters using the cartesian coordinate system of the request. The conversion to step coordinates is now done at the time of the step timing creation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepcompress: Fix compress_bisect_add() infinite loopKevin O'Connor2016-07-101-2/+6
| | | | | | | | At high step speeds, it is possible to exit the inner scan due to integer truncation. Always update minadd or maxadd so that the outer loop always terminates. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Avoid objcopy --dump-section flagKevin O'Connor2016-07-102-4/+1
| | | | | | | | | Commit da305e6b changed the objcopy command to use the --dump-section flag. However, the 2.24 version of avr-objcopy (which is common on raspbian installs) does not support this flag. Avoid using --dump-section and continue to use the -j option instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Add Arduino Due pin name aliasesKevin O'Connor2016-06-141-0/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* docs: Update documentation with Arduino Due installation infoKevin O'Connor2016-06-141-3/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Add initial support for Arduino Due boardsKevin O'Connor2016-06-1410-8/+606
| | | | | | | This adds basic support for running on the Atmel SAM3x8e micro-controllers that are found in the Arudino Due boards. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lib: Add Atmel SAM3x8e ARM CMSIS filesKevin O'Connor2016-06-14120-2/+24838
| | | | | | | Add the ARM CMSIS definitions (obtained from an Arduino copy of libsam) in preparation for Arduino Due support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support rescheduling of step events on faster MCUsKevin O'Connor2016-06-143-19/+80
| | | | | | | | | | On faster MCUs the step and unstep events may be too close for the stepper motor driver. Add a CONFIG_NO_UNSTEP_DELAY build option and support the case where it is not set. This allows faster MCUs to schedule two events for each step (one for the step and one for the unstep). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Update declfuncs.lds.S to only use progmem sections on AVRKevin O'Connor2016-06-143-7/+18
| | | | | | | On non-avr platforms the declfunc stuff still needs to be in the binary in a rodata section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialhdl: Avoid using 1200 baud during serial resetKevin O'Connor2016-06-141-1/+1
| | | | | | | The Arduino Due uses a 1200 baud connection to signal an erase sequence, so avoid it during normal serial resets. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr/serial: Separate out low-level hardware manipulation to its own functionKevin O'Connor2016-06-141-3/+9
| | | | | | | Introduce enable_tx_irq() for manipulating the AVR hardware. This keeps the low-level hardware code together. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Default to O2 optimizationKevin O'Connor2016-06-142-2/+2
| | | | | | | Default to O2 and set Os in the AVR makefile. Platforms besides AVR are likely to produce better code with O2 so make that the default. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Use 'unsigned int' instead of 'uint16_t' for shutdown reasonKevin O'Connor2016-06-142-4/+4
| | | | | | | Use 'unsigned int' instead of 'uint16_t' as is faster on some platforms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Use uint_fast8_t for return type of timersKevin O'Connor2016-06-147-14/+14
| | | | | | | | Some architectures are faster passing regular integers than 8bit integers. Use uint_fast8_t so that the architecture chooses the appropriate type. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Allow boards to define the return type of irq_save()Kevin O'Connor2016-06-138-25/+33
| | | | | | | | The AVR wants a uint8_t return type for irq_save(), but other architectures will generally prefer int. Allow the board to configure the size of the flag by introducing an irqstatus_t typedef. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Prefer irq_disable/enable instead of irq_save/restore in cmds/tasksKevin O'Connor2016-06-134-13/+13
| | | | | | | | Task and command handlers always run with irqs enabled, so it is not necessary to save/restore the irq state when disabling irqs in these handlers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwmcmds: Add Kconfig option to allow boards to disable hardware PWM commandsKevin O'Connor2016-06-135-70/+85
| | | | | | | | Some boards may not support hardware based PWM. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Add Kconfig option to allow boards to disable SPI commandsKevin O'Connor2016-06-133-1/+6
| | | | | | | Some boards may not support SPI transfers. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Add Kconfig option to allow boards to disable ADC commandsKevin O'Connor2016-06-136-113/+135
| | | | | | | | Some boards may not support the ADC hardware. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* compiler.h: Check if __aligned and __section macros are already definedKevin O'Connor2016-06-131-0/+4
| | | | | | | Don't define these macros if they are already - doing so causes compiler warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Move listing of directories to create to board makefilesKevin O'Connor2016-06-133-3/+7
| | | | | | Rename DIRS to dirs-y and populate it in the per-board Makefile rules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Add new file generic/io.h and move read/writeb() to itKevin O'Connor2016-06-133-19/+26
| | | | | | | | Move the definitions of the readb() style functions to a new header generic/io.h. This eliminates the dependency of stdint.h on compiler.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move simulator/gpio.h to generic/gpio.hKevin O'Connor2016-06-132-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move simulator/irq.h to new file generic/irq.hKevin O'Connor2016-06-134-34/+46
| | | | | | | Move the generic irq definitions into generic/irq.h and move the simulator irq code into main.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move board timer.h files into generic/misc.hKevin O'Connor2016-06-135-26/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>