Commit Graph

4246 Commits

Author SHA1 Message Date
Kevin O'Connor fc5353364a util: Use regular str() type in get_git_version() on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor 7a6fd1a1aa console: Use regular str() types for commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:52:31 -04:00
Kevin O'Connor d6c3aaad8a gcode: Use regular str() types for g-code commands on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.

Also, accept utf8 on gcode input (instead of just ascii).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-31 13:51:52 -04:00
Kevin O'Connor 85d0ef974c stm32: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:10:50 -04:00
Kevin O'Connor 45d4970712 atsam: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:10:15 -04:00
Kevin O'Connor 2692e493c8 atsamd: Remove gcc -mfpu=fpv4-sp-d16 floating point option
The floating point unit must be enabled in order to use it and Klipper
does not currently implement that.  Newer versions of gcc may spill
registers to the floating point unit causing failures.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-30 01:05:47 -04:00
Eric Callahan d90c3bc57a idle_timeout: exit the timer if the printer is shutdown
This resolves an issue where the timer can get stuck
in an attempt to transition from Ready to Idle if
the printer is shutdown.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-29 18:39:47 -04:00
Kevin O'Connor cf4bfb1119 tmc: Rename handle_stepper_enable() method to _handle_stepper_enable()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:56:44 -04:00
Kevin O'Connor 14bdc8e569 stepper: Remove unused _dist_to_time() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-29 11:41:59 -04:00
Kevin O'Connor 260f999b87 stepper: Remove unused SF_LAST_RESET flag
Tracking of the last reset is no longer needed after commit 8f76e53c.
Remove the code tracking that status and remove the flag definition.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 19:15:40 -04:00
Kevin O'Connor 7d95a00458 sched: Add repeat reschedule optimization
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:18:28 -04:00
Kevin O'Connor c015c0708f sched: Place common global variables into a struct
Some architectures do better if the global variables accessed from the
timer dispatch code are in a struct.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:18:28 -04:00
Kevin O'Connor 86fee2d517 tmc: Track requested hold_current so SET_TMC_CURRENT doesn't reduce it
The code automatically reduces the hold_current so that it is no
greater than the run_current.  However, this could lead to confusing
behavior if one reduced and then increased the run_current via
SET_TMC_CURRENT commands.  To avoid that, this change adds support for
tracking the requested hold_current - thus changes to run_current
don't subtly alter the hold_current.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 12:13:38 -04:00
Kevin O'Connor 627c1c5d2a rp2040: Add barrier() around all memcpy() calls in usbserial.c
Make sure gcc doesn't reorder any of the memcpy() calls to the usb
data ram.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-27 11:16:34 -04:00
Lasse Dalegaard de33180236 rp2040: add barrier in usb_read_ep0_setup
Some versions of gcc, in some cases, decide that it is OK to move the
read to `INTR` to right after clearing the `SETUP_REC` bit of
`SIE_STATUS`, instead of after the `memcpy`.

The rp2040 datasheet doesn't appear to say anything about how quickly
the `SETUP_REC` bit will be cleared in `INTR`, but regardless the
compiler should not be re-ordering the read like this.

Here we force the correct ordering using a memory barrier.

Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
2021-10-27 11:10:17 -04:00
Kevin O'Connor aa481fd9c3 test: Add an input_shaper module test case
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 20:01:33 -04:00
Kevin O'Connor 573fceefeb input_shaper: Fix python3 string encoding
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 20:01:33 -04:00
Kevin O'Connor b62171f350 input_shaper: Restore shaper_type config option
The shaper_type config option got removed in commit d5a7a7f0 - restore
that option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 18:06:11 -04:00
Dmitry Butyugin 54e21a7c26 input_shaper: Factored out AxisInputShaper class
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Dmitry Butyugin d5a7a7f00f input_shaper: Define input shapers in a single place in Python code
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-26 16:14:50 -04:00
Kevin O'Connor 6c395fd016 config: Minor updates to printer-tronxy-xy-2-Pro-2020.cfg
Change extruder microsteps to 32.  Add to printers.test regression
test case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-26 16:11:13 -04:00
gcastle2007 7af59a58cf
config: Tronxy XY-2 Pro default (#4631)
Example default config for Tronxy XY-2 Pro.

It is default config for printer Tronxy XY-2 Pro (mainboard Chitu V6). This config based on config for Tronxy X5SA with mainboard Chitu V6.

Signed-off-by: Konstantin Bazhenin <kby@list.ru>
2021-10-26 16:01:31 -04:00
Kevin O'Connor a33d0697b6 config: Don't use deprecated features in sample-pwm-tool.cfg
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-24 21:42:48 -04:00
Kevin O'Connor 7937678cb3 config: Remove deprecated features from printer-velleman-k8800-2017.cfg
Don't use deprecated default_parameter_x in
printer-velleman-k8800-2017.cfg .

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-24 21:41:52 -04:00
Kevin O'Connor cc9541092a test: Update test case to not use pin_map
Remove all users of the pin_map setting.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-24 21:11:53 -04:00
Kevin O'Connor f013b7bae6 test: Update test cases to use rotation_distance
Remove all users of step_distance from test configs.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-24 20:53:36 -04:00
Kevin O'Connor 823fdc9cb4 command: Make command_add_frame() and command_encodef() static
The only users of these two functions are in command.c so they can be
declared local to that code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-21 01:25:17 -04:00
Kevin O'Connor 92e1481a52 pru: Perform message encoding on pru0 to free space on pru1
Copy the parameters of calls to console_sendf() on pru1 to pru0 and
then call that function on pru0.  Although copying the parameters is a
"hack", the code size reduction is notable.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-21 01:25:17 -04:00
Kevin O'Connor 5c10001bc5 motan: Minor change to corexy analyzer label
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-16 22:18:51 -04:00
Kevin O'Connor cf3b7d290c motan: Add an analyzer to integrate accelerometer input
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-16 22:18:51 -04:00
Kevin O'Connor 466198c0f4 motan: Add support for graphing stepper motor phase and microstep position
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-16 22:18:51 -04:00
Kevin O'Connor 03021ae722 motan: Show data filename in graph title
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-16 22:18:45 -04:00
Eric Callahan ec2116b4f7 temperature_sensor: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan cd58a945e2 temperature_host: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan bf598d0922 lm75: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan 916ef4483a htu21d: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan e65b2593c6 heaters: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan 1153803360 ds18b20: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Eric Callahan c499451ab8 bme280: round reported temps to 2 decimal places
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-10-15 18:01:19 -04:00
Kevin O'Connor 9a0bcf21cf docs: Update mkdocs-requirements.txt
Update mkdocs to v1.2.3 to avoid a github "dependabot" warning for
CVE-2021-40978.  (The CVE doesn't impact the klipper3d.org site, but
no harm in updating.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-15 12:24:10 -04:00
creyc 27434128a4
config: Update generic-printrboard.cfg to mention different Y endstop pin on RevF hardware (#4732)
Signed-off-by: Corey Schiller <gitcor@venemo.com>
2021-10-15 11:56:16 -04:00
Ilia Rebane 372cd2834c
docs: Update BLTouch.md to prevent position_endstop error (#4731)
Klipper with Fluid complains about `position_endstop` line if `endstop_pin:
probe:z_virtual_endstop` used

Signed-off-by: Ilia Rebane <Agilatosay@gmail.com>
2021-10-15 11:55:20 -04:00
Arne Schwarck 96ee179e8b
config: Fix typo in Octopus board (#4801)
As suggested in https://github.com/Klipper3d/klipper/pull/4792

Signed-off-by: Arne Schwarck <arneschwarck@gmail.com>
2021-10-13 14:19:18 -04:00
Dmitry Butyugin 91466ebd43 adxl345: Renamed decode_samples and fixed/added checks on empty data
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
2021-10-13 11:56:52 -04:00
Arne Schwarck f72a2dc1ab
config: Fix diag pins on Octopus board (#4792)
with reference from https://github.com/bigtreetech/BIGTREETECH-OCTOPUS-V1.0/blob/master/Hardware/BIGTREETECH%20Octopus.pdf

Signed-off-by: Arne Schwarck <arneschwarck@gmail.com>
2021-10-13 11:50:56 -04:00
Kevin O'Connor 1e226a8893 stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chips
The F042 and F072 chips are in the same series and the code should be
nearly identical for these chips.  Implement the alias and enable USB
for the F072 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:25:41 -04:00
Kevin O'Connor 50f51d8aa2 stm32: Rework HAVE_GPIO_HARD_PWM in Kconfig
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-13 11:04:56 -04:00
Kevin O'Connor 97d36ac451 stm32: Change stm32f0 OSPEEDR to "medium" speed
The previous OSPEEDR value of 0x2 was copied from the stm32f4.c code,
but the stm32f0 interprets that value the same as 0x0 - which is "low"
speed.  Change the OSPEEDR value to "medium" speed so that it matches
the configuration of stm32f1 chips.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:43:31 -04:00
Kevin O'Connor 1b801508ba stm32: Add comments to configuration of OSPEEDR gpio speed
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-12 13:32:46 -04:00
Kevin O'Connor 9d9fe3cb1b stm32: Rework #if pin definition clauses in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-10-11 21:43:56 -04:00