Skip to content

Commit 688c39c

Browse files
committed
Avoid division by zero if SHAPING_FREQ_* is zero for disabled.
1 parent fe63324 commit 688c39c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Marlin/src/module/stepper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ constexpr ena_mask_t enable_overlap[] = {
159159
#endif
160160

161161
#ifndef SHAPING_MIN_FREQ
162-
#define SHAPING_MIN_FREQ _MIN(0x7FFFFFFFL OPTARG(INPUT_SHAPING_X, SHAPING_FREQ_X) OPTARG(INPUT_SHAPING_Y, SHAPING_FREQ_Y))
162+
#define SHAPING_MIN_FREQ _MIN(0x7FFFFFFFL OPTARG(INPUT_SHAPING_X, _MAX(SHAPING_FREQ_X, 1)) OPTARG(INPUT_SHAPING_Y, _MAX(SHAPING_FREQ_Y, 1)))
163163
#endif
164164
constexpr uint16_t shaping_min_freq = SHAPING_MIN_FREQ,
165165
shaping_echoes = max_step_rate / shaping_min_freq / 2 + 3;

0 commit comments

Comments
 (0)