diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2025-03-12 01:03:23 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2025-03-20 19:56:55 -0400 |
commit | 825d4baf9043e3f59055449483588b1832c084f2 (patch) | |
tree | 0615a18aa4ab1c6264195f32683722e826e172fa /src | |
parent | 8faed8d9fe113e0b7dc306d08c36986150550ca8 (diff) | |
download | kutter-825d4baf9043e3f59055449483588b1832c084f2.tar.gz kutter-825d4baf9043e3f59055449483588b1832c084f2.tar.xz kutter-825d4baf9043e3f59055449483588b1832c084f2.zip |
stepper: Support disabling optimized "step on both edges" in "make menuconfig"
Add a new "low level option" to allow users to configure if they want
to optimize for Trinamic drivers or traditional stepper motor drivers.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/Kconfig | 31 | ||||
-rw-r--r-- | src/stepper.c | 2 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/Kconfig b/src/Kconfig index 0e4ea1c5..e1ecbdf9 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -201,6 +201,29 @@ config CANBUS_FILTER bool default y if CANSERIAL +# Stepper optimizations +config INLINE_STEPPER_HACK + # Enables gcc to inline stepper_event() into the main timer irq handler + bool + depends on HAVE_GPIO + default y +config HAVE_STEPPER_OPTIMIZED_BOTH_EDGE + bool +config WANT_STEPPER_OPTIMIZED_BOTH_EDGE + bool "Optimize stepper code for 'step on both edges'" if LOW_LEVEL_OPTIONS + depends on INLINE_STEPPER_HACK && HAVE_STEPPER_OPTIMIZED_BOTH_EDGE + default y + help + Optimize the stepper code for Trinamic stepper motor drivers + that are configured in UART or SPI mode (and thus can perform + a step on both "edges" of the step pin). Enabling this option + typically improves the stepper cpu performance by about 20% + when using these drivers. If this option is disabled the code + will instead deploy optimizations that improve the cpu + performance by about 20% for traditional drivers (those that + take a step only on the "rising" or "falling" level of the + step pin). + # Support setting gpio state at startup config INITIAL_PINS string "GPIO pins to set at micro-controller startup" @@ -229,15 +252,7 @@ config HAVE_STRICT_TIMING bool config HAVE_CHIPID bool -config HAVE_STEPPER_OPTIMIZED_BOTH_EDGE - bool config HAVE_BOOTLOADER_REQUEST bool config HAVE_LIMITED_CODE_SIZE bool - -config INLINE_STEPPER_HACK - # Enables gcc to inline stepper_event() into the main timer irq handler - bool - depends on HAVE_GPIO - default y diff --git a/src/stepper.c b/src/stepper.c index f6f798c6..95c9a2f2 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -16,7 +16,7 @@ DECL_CONSTANT("STEPPER_STEP_BOTH_EDGE", 1); -#if CONFIG_INLINE_STEPPER_HACK && CONFIG_HAVE_STEPPER_OPTIMIZED_BOTH_EDGE +#if CONFIG_INLINE_STEPPER_HACK && CONFIG_WANT_STEPPER_OPTIMIZED_BOTH_EDGE #define HAVE_OPTIMIZED_PATH 1 #define HAVE_EDGE_OPTIMIZATION 1 #define HAVE_AVR_OPTIMIZATION 0 |