Various Laser / Spindle improvements (#15335)

This commit is contained in:
Ben
2020-04-03 01:31:08 +01:00
committed by GitHub
parent e7e9304819
commit df8b7dfc40
24 changed files with 776 additions and 169 deletions

View File

@ -36,18 +36,29 @@
START_MENU();
BACK_ITEM(MSG_MAIN);
if (cutter.enabled()) {
#if ENABLED(SPINDLE_LASER_PWM)
EDIT_ITEM(CUTTER_MENU_TYPE, MSG_CUTTER(POWER), &cutter.power, SPEED_POWER_MIN, SPEED_POWER_MAX);
#endif
#if ENABLED(SPINDLE_LASER_PWM)
EDIT_ITEM_FAST(CUTTER_MENU_POWER_TYPE, MSG_CUTTER(POWER), &cutter.setPower, cutter.interpret_power(SPEED_POWER_MIN), cutter.interpret_power(SPEED_POWER_MAX),
[]{
if (cutter.isOn) {
cutter.power = cutter.setPower;
}
});
#endif
if (cutter.enabled() && cutter.isOn)
ACTION_ITEM(MSG_CUTTER(OFF), cutter.disable);
}
else {
ACTION_ITEM(MSG_CUTTER(ON), cutter.enable_forward);
#if ENABLED(SPINDLE_CHANGE_DIR)
ACTION_ITEM(MSG_SPINDLE_REVERSE, cutter.enable_reverse);
#endif
}
#if ENABLED(MARLIN_DEV_MODE)
#if ENABLED(HAL_CAN_SET_PWM_FREQ) && defined(SPINDLE_LASER_FREQUENCY)
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000,[]{ cutter.refresh_frequency();});
#endif
#endif
END_MENU();
}