klipper/src
Kevin O'Connor a6a6b21e4d armcm_timer: Use a static instruction count for TIMER_MIN_TRY_TICKS
Change TIMER_MIN_TRY_TICKS from 2us to 90 instructions.

On newer chips 2us is a large amount of time - for example on the
520Mhz stm32h723 it would be 1040 instructions.  Using a large time
can result in "busy waiting" in the irq handler when the cpu may be
better spent running tasks.

The armcm_timer.c code is used on most ARM cortex-M chips and on all
of these chips the SysTick timer should be tied directly to the
instruction counter.  This change should be safe because it should not
take more than 90 instructions to reschedule the timer on any of these
chips.  Also, all of these chips should be able to exit the irq
handler and reenter it in less than 90 instructions allowing more time
for tasks to run if the next timer is more than 90 timer ticks in the
future.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2025-12-03 17:47:50 -05:00
..
ar100 ar100: Convert to or1k-elf toolchain 2025-06-08 14:15:50 -04:00
atsam stepper: Support step on both edges with custom minimum pulse duration 2025-03-20 19:56:55 -04:00
atsamd Kconfig: Note which chips require software divide operations 2025-04-17 12:09:19 -04:00
avr timer_irq: Remove TIMER_IDLE_REPEAT_TICKS special case 2025-12-03 17:47:50 -05:00
generic armcm_timer: Use a static instruction count for TIMER_MIN_TRY_TICKS 2025-12-03 17:47:50 -05:00
hc32f460 Kconfig: Note which chips require software divide operations 2025-04-17 12:09:19 -04:00
linux sched: Improve timer vs task priority check 2024-10-26 22:09:14 -04:00
lpc176x Kconfig: Add new WANT_ADC option to reduce code size 2025-04-16 13:54:44 -04:00
pru Revert "Makefile: Don't disable gcc's use-linker-plugin option" 2025-04-16 15:24:05 -04:00
rp2040 rp2040: Prefer larger postdiv1 on rp2040 chips 2025-06-02 14:10:42 -04:00
simulator command: Fix handling of buffer passing in args[] on 64bit mcu 2020-10-30 14:04:12 -04:00
stm32 stm32: f0 i2c clean nackcf interrupt on handle 2025-11-26 14:31:54 -05:00
adccmds.c adccmds: Run gpio_adc_setup() before oid_alloc() 2019-01-13 11:03:30 -05:00
basecmd.c basecmd: Update stats timing check to support 32bit duration 2025-04-28 19:28:52 -04:00
basecmd.h stepper: Use a reusable interface to the "move queue" 2020-12-04 16:10:13 -05:00
buttons.c buttons: initialize mcu buttons based on inverted state 2019-07-05 20:01:07 -04:00
byteorder.h byteorder: Add a header file defining common byteswap functions 2018-05-21 09:44:40 -04:00
command.c command: Support 2-byte message ids 2024-06-10 12:27:12 -04:00
command.h command: Support 2-byte message ids 2024-06-10 12:27:12 -04:00
compiler.h compiler.h: Check if __aligned and __section macros are already defined 2016-06-13 23:18:59 -04:00
ctr.h ctr: Encode negative integers in normal hex notation 2019-08-22 13:06:44 -04:00
debugcmds.c debugcmds: Remove start/end_group commands 2021-05-07 13:53:47 -04:00
endstop.c trsync: Introduce new "trigger synchronization" support 2021-06-09 18:58:35 -04:00
gpiocmds.c gpiocmds: Merge digital output and soft pwm code 2020-12-10 12:06:26 -05:00
i2c_software.c i2c_software: Place wires in high impedance state after setup 2025-07-22 14:04:50 -04:00
i2c_software.h i2c: handle errors at i2ccmds 2024-10-26 22:06:30 -04:00
i2ccmds.c i2ccmds: move status checks to function 2024-10-26 22:06:30 -04:00
i2ccmds.h ldc1612: shutdown on i2c errors 2024-10-26 22:06:30 -04:00
initial_pins.c initial_pins: Add check to reduce compile time size when not in use 2022-12-16 22:46:47 -05:00
initial_pins.h initial_pins: Add ability to configure output pins at mcu startup 2019-03-17 20:56:25 -04:00
Kconfig load_cell_probe: Create load_cell_probe MCU object 2025-05-29 19:06:48 -04:00
lcd_hd44780.c lcd_hd44780: Make sure nsecs_to_ticks() is always inlined 2025-04-17 12:09:19 -04:00
lcd_st7920.c lcd_st7920: Make sure nsecs_to_ticks() is always inlined 2025-04-17 12:09:19 -04:00
load_cell_probe.c load_cell_probe: Fix warnings on avr builds 2025-06-18 11:09:58 -04:00
load_cell_probe.h load_cell_probe: Create load_cell_probe MCU object 2025-05-29 19:06:48 -04:00
Makefile load_cell_probe: Create load_cell_probe MCU object 2025-05-29 19:06:48 -04:00
neopixel.c neopixel: Increase PULSE_LONG_TICKS to 800 for compatibility 2025-11-13 15:15:28 -05:00
pulse_counter.c pulse_counter: Use "clock" suffix instead of "time" in commands 2021-04-30 11:40:37 -04:00
pwmcmds.c pwmcmds: Use move queue for hard PWM 2020-12-04 16:10:13 -05:00
sched.c sched: Improve timer vs task priority check 2024-10-26 22:09:14 -04:00
sched.h sched: Improve timer vs task priority check 2024-10-26 22:09:14 -04:00
sdiocmds.c stm32: Add sdio support 2023-02-20 19:55:25 -05:00
sdiocmds.h stm32: Add sdio support 2023-02-20 19:55:25 -05:00
sensor_ads1220.c sensor_hx71x: Update Sensors to report to load_cell_probe 2025-05-29 19:07:49 -04:00
sensor_adxl345.c sensor_adxl345: No need to schedule start of bulk reading 2024-01-19 11:55:15 -05:00
sensor_angle.c angle: mt6826s added support 2024-12-12 14:28:45 -05:00
sensor_bulk.c sensor_bulk: New C file with helper code for sending bulk sensor measurements 2024-01-19 11:55:15 -05:00
sensor_bulk.h sensor_bulk: Change maximum data size from 52 to 51 bytes 2024-06-10 12:27:12 -04:00
sensor_hx71x.c sensor_hx71x: Update Sensors to report to load_cell_probe 2025-05-29 19:07:49 -04:00
sensor_icm20948.c icm20948: Add support for ICM20948 accelerometer (#6756) 2025-03-04 17:12:26 -05:00
sensor_ldc1612.c ldc1612: shutdown on i2c errors 2024-10-26 22:06:30 -04:00
sensor_lis2dw.c sensor_lis2dw: Read 8 samples at a time from sensor fifo 2025-10-13 20:36:11 -04:00
sensor_mpu9250.c mpu: shutdown on i2c errors 2024-10-26 22:06:30 -04:00
sos_filter.c sos_filter: fix overflows_int32 (#6976) 2025-07-11 11:08:35 -04:00
sos_filter.h sos_filter: Second Order Sections MCU Filter 2025-05-29 19:01:38 -04:00
spi_software.c spi_software: add a delay on mode change 2025-05-26 18:44:29 -04:00
spi_software.h spi_software: Implementation of software spi 2019-02-13 11:52:20 -05:00
spicmds.c Kconfig: Support selecting optional features on chips with small flash size 2023-06-08 12:59:30 -04:00
spicmds.h sensor_angle: Add support for bulk querying of spi angle sensors 2022-03-29 20:34:46 -04:00
stepper.c stepper: Minor code tweak - remove unneeded parenthesis 2025-05-09 12:58:01 -04:00
stepper.h trsync: Introduce new "trigger synchronization" support 2021-06-09 18:58:35 -04:00
thermocouple.c thermocouple: Only shutdown on multiple consecutive sensor errors 2022-09-23 11:56:20 -04:00
tmcuart.c command: Add command_decode_ptr() helper 2020-10-30 14:04:08 -04:00
trsync.c trsync: Don't require callers of trsync_do_trigger() to disable irqs 2024-10-26 22:11:02 -04:00
trsync.h trsync: Introduce new "trigger synchronization" support 2021-06-09 18:58:35 -04:00