5652 Commits

Author SHA1 Message Date
Timofey Titovets
2e82fc4790 spi_flash: fix hw bus
_try_send_command() expects a list of args,
But receives a string.

Fixes abc76ee963d4154dce0bd56f2fdb946d5065cc86.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-28 15:58:55 -04:00
Timofey Titovets
bfda326c24
spi_flash: fix spi bus switch (#6906)
Fixes abc76ee963d4154dce0bd56f2fdb946d5065cc86.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-20 11:39:24 -04:00
Russell Cloran
f2b27d17b7 stm32: Add support for spi6 on stm32f42x chips
Signed-off-by: Russell Cloran <rcloran@gmail.com>
2025-04-19 12:12:55 -04:00
Kevin O'Connor
5001983d34 stm32: Fix pll_base on stm32h7 when using a clock other than 25Mhz
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-19 12:09:58 -04:00
Kevin O'Connor
73e27aee4f docs: Update benchmarks for stm32h7
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-19 12:03:55 -04:00
Kevin O'Connor
0d27195fd4 stm32: Add optimized stm32h7_gpio.c
Add optimized gpio functions for stm32h7 - caching the ODR register
can notably improve the performance of the gpio_out_toggle() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-19 11:48:58 -04:00
Kevin O'Connor
1f5783a250 probe: Remove ProbeEndstopSessionHelper
Have all callers instantiate the individual helper classes directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
37952e8686 probe_eddy_current: Separate probe style commands from homing operations
Separate homing operations (as called from probe:z_virtual_endstop)
from the normal probe command handling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
ab9b9e8584 probe_eddy_current: Do not support QUERY_PROBE command
Report an error if a user issues a QUERY_PROBE command (instead of
always returning not-triggered).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
3fb1191cad probe: Add a new LookupZSteppers helper class
Split code to lookup the Z stepper from HomingViaProbeHelper to new
LookupZSteppers class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f3a1c914a4 probe: Convert probing_move() callback to use regular probe sessions system
Use the normal probe_session_start(), run_probe(),
pull_probed_results(), and end_probe_session() API from
ProbeSessionHelper.  This removes the custom probing_move() callback.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
b2e36e5d98 probe: Change probing_move() to pass a gcmd instead of (pos, speed)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
ff0ffedd17 probe: Add a new ProbeParameterHelper class
Split multi-sample config reading from ProbeSessionHelper to a new
ProbeParameterHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
1e87d26707 probe: Add a new lookup_minimum_z() helper function
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
f8de9ae080 probe: Add a new ProbeEndstopSessionHelper class
Move the HomingViaProbeHelper() instance from ProbeSessionHelper to a
new ProbeEndstopSessionHelper class.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
6a87c5e9f5 probe: Add a default probing_move() function to HomingViaProbeHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:38:34 -04:00
Kevin O'Connor
db7a9cf071 manual_stepper: Implement "drip moves" for manual stepper STOP_ON_ENDSTOP
Currently, `MANUAL_STEPPER STOP_ON_ENDSTOP=1` type commands will move
until hitting the endstop, but it will still always consume the total
amount of move time.  That is, following moves can't be started until
the total possible time of the homing move is completed.

Implement "drip moves" so that the code only schedules the movement in
small segments.  This allows following movements to be scheduled
without a significant delay.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Kevin O'Connor
765de72f9e toolhead: Avoid toolhead.move() and toolhead._process_moves() in drip_move()
Implement move checking and trapq loading directly from drip_move().
This simplifies the interactions between these components.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Kevin O'Connor
6202a0f3bc toolhead: Avoid LookAheadQueue calling back into toolhead class
Avoid lookahead.flush() calling back into toolhead._process_moves().
Instead, rename toolhead._process_moves() to
toolhead._process_lookahead(), have it call lookahead.flush(), and
consistently use it when flushing the lookahead queue.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-18 14:32:23 -04:00
Kevin O'Connor
413ff19ea8 neopixel: Add comments on timing
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 13:06:22 -04:00
Kevin O'Connor
4e7fcc2704 check-software-div: Add a new build check for software divide
Update the build checks to include a check for unexpected software
divide operations.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:09:19 -04:00
Kevin O'Connor
871637d3f2 Kconfig: Note which chips require software divide operations
Add a new HAVE_SOFTWARE_DIVIDE_REQUIRED that indicates which chips
require software divide.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:09:19 -04:00
Kevin O'Connor
0fbcc156c5 neopixel: Make sure nsecs_to_ticks() is always inlined
It is a compile-time calculation that needs to be inlined to work.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:09:19 -04:00
Kevin O'Connor
56d3f4e64c lcd_st7920: Make sure nsecs_to_ticks() is always inlined
It is a compile-time calculation that needs to be inlined to work.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:09:19 -04:00
Kevin O'Connor
cb6828ec34 lcd_hd44780: Make sure nsecs_to_ticks() is always inlined
It is a compile-time calculation that needs to be inlined to work.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:09:19 -04:00
Kevin O'Connor
3656006a30 stm32: Change hard_pwm.c MAX_PWM to 257
Choose a value for MAX_PWM that avoids an expensive run-time division.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:07:44 -04:00
Kevin O'Connor
7a9b06ad86 stm32: Fix prescaler overflow check in hard_pwm.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 12:07:44 -04:00
Kevin O'Connor
acd96047de docs: Update Config_Changes.md to note software spi is now rate limited
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-17 11:54:25 -04:00
Russell Cloran
516ef1d361 hall_filament_width_sensor: Add filament switch values to status
`hall_filament_width_sensor` contains a runout sensor object internally.
This exposes those values in the API status result.

```
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","filament_detected","is_active","Diameter","Raw"]}}}
GOT: b'{"id":123,"result":{"eventtime":199567.823596603,"status":{"hall_filament_width_sensor":{"enabled":true,"filament_detected":true,"is_active":true,"Diameter":1.9499999999999986,"Raw":6113}}}}'
```

The duplication of `is_active` and `enabled` seems confusing, but both
of these can be independently manipulated by GCode:

```
SEND: {"id":123,"method":"gcode/script","params":{"script":"DISABLE_FILAMENT_WIDTH_SENSOR"}}
GOT: b'{"id":123,"result":{}}'
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","is_active"]}}}
GOT: b'{"id":123,"result":{"eventtime":199770.446013297,"status":{"hall_filament_width_sensor":{"enabled":true,"is_active":false}}}}'

SEND: {"id":123,"method":"gcode/script","params":{"script":"SET_FILAMENT_SENSOR SENSOR=hall_filament_width_sensor ENABLE=0"}}
GOT: b'{"id":123,"result":{}}'
SEND: {"id":123,"method":"objects/query","params":{"objects":{"hall_filament_width_sensor":["enabled","is_active"]}}}
GOT: b'{"id":123,"result":{"eventtime":199847.927726196,"status":{"hall_filament_width_sensor":{"enabled":false,"is_active":false}}}}'
```

Signed-off-by: Russell Cloran <rcloran@gmail.com>
2025-04-17 11:44:26 -04:00
Timofey Titovets
b9757c9b69 tmc: add missing freewheel config options
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:42:44 -04:00
Timofey Titovets
a9b04e8536 i2c_software: pass pulse ticks from host
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:41:49 -04:00
Timofey Titovets
841adcfff7 i2c_software: reduce gpio calls count
gpio reset calls are heavy.
gpio state are persistent between calls.
Drop useless calls.
Avoid calls if SDA does not changed.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:41:49 -04:00
Timofey Titovets
8ab12c86bf i2c_software: allow freq adjust
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:41:49 -04:00
Timofey Titovets
abc76ee963 software_spi: set rate limiting ticks from the host
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:37:12 -04:00
Timofey Titovets
b826844b34 spi_software: respect expected rate
On fast MCU software spi may violate maximally supported by TMC driver rate.

Add dynamic limits to overcome that.

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
2025-04-17 11:37:12 -04:00
Kevin O'Connor
017371b744 Revert "Makefile: Don't disable gcc's use-linker-plugin option"
This reverts commit 8087200ffe2fbbe62265dd480ce8be67db8349eb.

The change can break the build on some versions of gcc.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 15:24:05 -04:00
Kevin O'Connor
4aa2250221 test: Disable all additional features in atmega328 build
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 15:24:05 -04:00
JamesH1978
49d9ed22bf
config: Update generic-bigtreetech-skr-2.cfg - SPI Drivers (#6895)
Added SPI tmc2130 driver config

Signed-off-by: James Hartley <james@hartleyns.com>
2025-04-16 14:13:17 -04:00
Kevin O'Connor
51311948be atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chips
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
61bbd455cf Kconfig: Add some user visible comments to the optional features menu
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
d93645a750 stm32: Simplify Makefile
Breakout selection of timer and gpioperiph objects.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
8c67adc164 Kconfig: Add new WANT_ADC option to reduce code size
Make it possible to not compile in support for ADC on chips with small
flash sizes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
04e7eb20fd Kconfig: Add new WANT_I2C option to reduce code size
Make it possible to not compile in support for I2C on chips with small
flash sizes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
868760f5b1 Kconfig: Add new WANT_SPI option to reduce code size
Make it possible to not compile in support for SPI on chips with small
flash sizes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
b0fa36e221 Kconfig: Add new WANT_HARD_PWM option to reduce code size
Make it possible to not compile in support for hardware pwm on chips
with small flash sizes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
6356e3d35c stm32: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
6e9b5b309c avr: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZE
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:44 -04:00
Kevin O'Connor
d98abfc5db Kconfig: Replace WANT_DISPLAYS with individual options
Support setting WANT_ST7920 and WANT_HD44780 individually.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:39 -04:00
Kevin O'Connor
c3c64adc32 Kconfig: Replace WANT_GPIO_BITBANGING with individual options
Support setting individual options instead of one global option (
WANT_BUTTONS, WANT_TMCUART, WANT_NEOPIXEL, WANT_PULSE_COUNTER,
WANT_HX71X).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:54:27 -04:00
Kevin O'Connor
efc2d9b364 workflows: Update github build-test.yaml to ubuntu-22.04
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-04-16 13:19:54 -04:00