Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» M593 F "min" freq
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 18, 2022
1 parent 92b2076 commit cfa747e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/gcode/feature/input_shaping/M593.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void GcodeSuite::M593() {

if (parser.seen('F')) {
const float freq = parser.value_float();
constexpr float max_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
if (freq == 0.0f || freq > max_freq) {
constexpr float min_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
if (freq == 0.0f || freq > min_freq) {
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq);
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
}
else
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", max_freq, " or 0 to disable");
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", min_freq, " or 0 to disable");
}
}

Expand Down

0 comments on commit cfa747e

Please sign in to comment.