Commit Graph

285 Commits

Author SHA1 Message Date
Kevin O'Connor bf647749dd menu: Don't peek into printer.objects member variable
Use the printer.lookup_objects() method to get the list of available
printer objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 12:03:46 -05:00
Kevin O'Connor 857e7ed5f1 klippy: Convert printer_state("connect") to an event handler
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>
2019-01-08 11:09:55 -05:00
Kevin O'Connor 797367b9f5 klippy: Convert printer_state("ready") to an event handler
Convert all users of the printer_state("ready") handler to register a
"klippy:ready" event handler instead.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-08 10:59:43 -05:00
Kevin O'Connor fb7fe282c8 klippy: Convert printer_state("shutdown") to an event handler
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>
2019-01-08 10:59:43 -05:00
Petri Honkala b2d5a8e65b z_tilt: unresolved reference fixed
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2019-01-08 08:44:25 -05:00
Janar Sööt 3a4a1d678e menu: allow empty command gcode if action is present
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 0cbe851777 menu: enhancements
- changes that make easier to use menu as module UI
- new helper method for delayed callbacks
- method for getting the menu instance from display
- new action for sending menu:action events
- allow_without_selection option for cards

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:39:50 -05:00
Janar Sööt 005cbe157a menu: allow names in card content and simplify define single card decks
Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:53 -05:00
Janar Sööt b9cccc5959 menu: support for click button long press
- long press with timer (button release is not needed anymore)
- initial support for edit mode long press gcode

Signed-off-by: Janar Sööt <janar.soot@gmail.com>
2019-01-07 21:38:45 -05:00
Kevin O'Connor e26d1a3567 i2ccmds: Pass the i2c address as a 7-bit number (0-127)
The sam3 i2c code and the linux code use a 7-bit i2c address, while
the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the
least significant bit always zero.  A similar issue occurred in the
host code (sx1509.py and replicape.py use 7-bit addresses while
uc1701.py and mcp4451.py use 8-bit addresses).

Consistently use 7-bit addresses in all the code.  This breaks
compatibility between host and mcu software, so make a change to the
config_i2c command to force users to synchronize software updates.
This also breaks common Smoothieboard configs, so update the mcp4451
code to validate the i2c_address.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-07 20:00:44 -05:00
Master92 6ccc0732c1 menu: Fix filament loading and unloading feature (#1082)
As discussed in #1057, the default loading- and unloading procedure does
not behave as expected. Setting the extruder to relative mode fixes this.

Signed-off-by: Nils Friedchen <Nils.Friedchen@googlemail.com>
2019-01-07 10:25:19 -05:00
Paulo Drugos ffbb4198c1 menu: Correction for the resume option appears when the toolhead is not printing (#1077)
Signed-off-by: Paulo Drugos paulodrugos@gmail.com
2019-01-05 19:11:03 -05:00
Kevin O'Connor c3efcd9c8d bus: Set all SPI CS pins high before first config_spi message
If an SPI device is shared among many devices, then all the device's
CS pins should be set high prior to setting up the clk pin.
(Otherwise, there's a chance a device could interpret the clk pin
setup as part of a transmission.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 22:26:34 -05:00
Kevin O'Connor 7fe14f05e6 thermistor: Avoid divide by zero error if min_temp=-273.15
Reported by @TheGuv.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-04 12:47:37 -05:00
Kevin O'Connor c2086796bf mcp4728: Add initial support for the mcp4728 i2c dac chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 18:17:56 -05:00
Alec B. Plumb 59e9b6562f respond: An extra for sending messages to the printer host. (#1053)
I have made one change to `gcode.py` to support quoted parameter
values.

I have added support for the basic `M118` command (see
https://reprap.org/wiki/G-code#M118:_Echo_message_on_host). I have
also added a `RESPOND` command that takes extended parameters.
`ECHO` might be a better name than `RESPOND` but is already defined
in `gcode.py`.

Signed-off-by: Alec B. Plumb <alec@etherwalker.com>
2019-01-02 17:45:35 -05:00
john-- f6c9150349 heater: take a gcode_id when setting up a heater (#1028)
Allow an arbitrary gcode_id to be supplied during heater setup. This allows future extras to register additional IDs beyond B, and T#.

Signed-off-by: John Jardine <john@gprime.net>
2019-01-02 17:44:02 -05:00
Kevin O'Connor 1be24b8fc7 bus: Don't raise a "duplicate pin" warning on None pins
If "None" is used for an spi cs pin, then it should not reserve "None"
for other uses.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:37:39 -05:00
Kevin O'Connor 68ebde0d86 display: Fix handling of M117 command if lowercase 'm' is used
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-01-02 17:34:56 -05:00
Petri Honkala e4e0fec681 tmc2660: error and whitespace fixes
- redundant parentheses removed
	- parameter reference fixed
	- raise error fixed

Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Petri Honkala f99002df4f tmc2208: error raise fixed for rx/tx mcu check
Signed-off-by: Petri Honkala <cruwaller@gmail.com>
2018-12-27 11:44:41 -05:00
Kevin O'Connor d0f09727a9 bltouch: Issue both a "reset" and a "pin_up" after a successful probe
Not all BLTouch clones raise the pin on a "reset" request, so
explicitly send a "pin_up" command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:46 -05:00
Kevin O'Connor ccc25a03d5 bltouch: Add a config option to disable the bltouch sensor test
It appears some bltouch "clones" do not report the probe as triggered
when put in "touch mode" while the pin is raised.  Add a config option
to allow users to disable the test.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:41 -05:00
Kevin O'Connor ce064e6e2d bltouch: Always make sure to check the endstop at least every 1ms
Some of the bltouch implementations may only respond to a probe event
with a 5ms pulse.  Make sure to check the signal pin at least every
millisecond to ensure no signal is lost.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-16 11:06:27 -05:00
Kevin O'Connor 76b57ba05a bltouch: Fix typo in pin_move_time parsing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 11:43:04 -05:00
Kevin O'Connor 44aa5def73 bltouch: Allow the pin_move_time to be configured
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-04 10:34:54 -05:00
Kevin O'Connor e0b2d7c51d bltouch: Add a BLTOUCH_DEBUG command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-03 22:52:32 -05:00
Kevin O'Connor aac92ffb91 bltouch: Fix bug - must restore stepper position after homing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-12-01 22:09:06 -05:00
Arksine cf6a56cebf bed_mesh: Introduce fade_target option
To deal potential z scaling when fade is enabled, a fade_target option has been introduced.  This option may either be set to 0.0 or any z position within the range of the mesh.  A value of 0.0 will result in previous behavior, where z adjustment phases out until no further adjustment is added.  A non-zero value will phase out adjustment until the target has been reached, after which the rest of the print will be offset along the z axis by the fade_target.  By default the fade_target will be calculated as an average of the mesh.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Arksine 35f41b7402 bed_mesh: Disable z-adjustment fade by default.
Due to various potential issues with fading out z-adjustment, it is better to disable by default and allow users to opt-in.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2018-11-30 11:37:21 -05:00
Kevin O'Connor 824e55d75a bltouch: Add initial support for a bltouch "extras" module
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-30 11:34:20 -05:00
Kevin O'Connor a726c58671 mcp4451: Minor update - remove unnecessary mcu import
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:36:49 -05:00
Kevin O'Connor 147d805231 mcp4451: Use bus.py helper code for i2c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-24 00:33:22 -05:00
Kevin O'Connor e5150fe187 uc1701: Add support for SSD1306 in i2c mode
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-23 22:04:06 -05:00
Kevin O'Connor d2aa78c16a uc1701: Cache icons and fonts in byte display order
This reduces the amount of bit manipulaton needed during screen
updates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 065a8eb826 uc1701: Wrap code to 80 columns
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a79d87ca8e uc1701: Add all_framebuffers to reduce vram indexing in the code
Add a self.all_framebuffers variable and change self.vram to only
contain the new display data.  This allows the main code to access the
self.vram member variable without the need to index for current/old
data.  (It also updates the code to match the latest st7920 and
hd44780 code.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor e231ac7422 uc1701: Add support for SSD1306 displays
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor a00d7b418f display: Add a get_dimensions() method to lcd chip classes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 20:45:53 -05:00
Kevin O'Connor 9ba94ded9e tmc2660: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 1c71ea27e0 uc1701: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 5bb0bd755d tmc2130: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor ab6a8ec76e ad5206: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor be58c7f8ec replicape: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 7cadd8d3f4 spi_temperature: Use bus.py helper code for spi
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor 58890e32a2 bus: Add klippy/extras/bus.py module with SPI bus helper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-21 12:12:31 -05:00
Kevin O'Connor f3c4deb1ab lpc176x: Convert i2c code to use standard i2ccmds.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2018-11-14 10:23:56 -05:00
Jiri Dobry e541466591 servo: This patch create ability to enable/disable attached servo. (#880)
Cheap mechanical servos have small flickering. When this servo stay on one position, this flickering slowly destroy internal potentiometer and make servo unusable. Many mechanisms need servo only to change position. Therefore I create this minor path to enable/disable servo. It stop pulses for this servo, that's all.

Corresponding G-code is:
SET_SERVO SERVO=config_name [WIDTH=] [ENABLE=<0|1>]
SET_SERVO SERVO=config_name [ANGLE=] [ENABLE=<0|1>]

For example:
SET_SERVO SERVO=touch ANGLE=80 ENABLE=1 ; enable servo and set position
G4 P200 ; wait 200ms
SET_SERVO SERVO=touch ENABLE=0 ; disable servo

This patch add one option to servo configuration:
enable: <False/True> # default True

It not have impact to user code existing already because it is optional parameter and default value is same as original behavior.

Signed-off-by: Jiri Dobry <jdobry@centrum.cz>
2018-11-14 09:38:09 -05:00
James b45ccfea97 display: FR icon changed to "Feed Rate" (#860)
Signed-off-by: James Wood <j@j-w.co>
2018-11-13 10:14:01 -05:00
Lucas Fink f6c2e8b4eb bed_mesh: Fix some fragile identity comparisons
Signed-off-by: Lucas Fink <software@lfcode.ca>
2018-10-31 16:02:45 -04:00