-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINIMUM_STEPPER_PULSE to MINIMUM_STEPPER_PULSE_NS #27113
MINIMUM_STEPPER_PULSE to MINIMUM_STEPPER_PULSE_NS #27113
Conversation
Since a config option has changed / been renamed, you’ll need to add it to |
Thanks, done. |
79f3f9a
to
1f61862
Compare
Some of these things defined as |
95a7da1
to
03a9848
Compare
Marlin/src/HAL/TEENSY40_41/timers.h
Outdated
@@ -36,13 +36,13 @@ | |||
typedef uint32_t hal_timer_t; | |||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFE | |||
|
|||
#define GPT_TIMER_RATE F_BUS_ACTUAL // 150MHz | |||
#define GPT_TIMER_RATE F_BUS // 150MHz (Can't use F_BUS_ACTUAL because it's extern volatile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is only 1/4 of the full F_CPU
speed, but it's unclear whether we can run interrupt timers at such a high resolution as 1/1, or that we need to. All counts would require two extra bits.
Since F_BUS_ACTUAL
is volatile
, perhaps the system clock speed is able to change dynamically, or maybe this is only done under program control. If Marlin is able to keep the clock at a constant rate then we should be ok just using F_BUS
, which is provided by the Teensy platform. I'm not sure yet how F_CPU
and F_BUS
are defined, since you can change the CPU speed with PlatformIO option board_build.f_cpu
. If Teensy isn't picking up board_build.f_cpu
then we may add our own -DF_CPU
or some other define that Teensy platform is expecting.
f98ab3a
to
6785e90
Compare
If there is indeed some math / comparison being done between timer ticks/ |
MarlinFirmware/Marlin#27113 Co-Authored-By: Mihai <299015+mh-dm@users.noreply.github.com>
b71da5c
to
92fe629
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a pass over everything at 92fe629 commit and it looks good.
Thanks for the review. If more variables, methods, and parameters should be working with |
… into bugfix-2.1.x * 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin: ✏️ Fix comma typo (MarlinFirmware#27138) [cron] Bump distribution date (2024-06-08) 📝 Remove dead video links [cron] Bump distribution date (2024-06-06) 🔧 Minimum Stepper Pulse in Nanoseconds (MarlinFirmware#27113)
Description
Switch from
MINIMUM_STEPPER_PULSE
(in µs) toMINIMUM_STEPPER_PULSE_NS
(in nanoseconds). This PR is basically just code refactoring. Note thatMINIMUM_STEPPER_PULSE
is inConfiguration_adv.h
and if left undefined it is automatically configured byConditionals_adv.h
based on the used stepper drivers.Benefits
Cleaner code for handling stepper motor drivers that can do sub microsecond step pulse widths (like LV8729 and TMC2xxx). Allows easier user experimentation with sub microsecond step pulse widths.