🧑‍💻 M593 F "min" freq

This commit is contained in:
Scott Lahteine 2022-12-18 15:48:47 -06:00
parent 92b2076dda
commit cfa747ed08

View File

@ -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");
}
}