Improvements for Laser / Spindle (#17661)
This commit is contained in:
@ -73,7 +73,6 @@ void menu_configuration();
|
||||
#endif
|
||||
|
||||
#if HAS_CUTTER
|
||||
#include "../../feature/spindle_laser.h"
|
||||
void menu_spindle_laser();
|
||||
#endif
|
||||
|
||||
|
@ -34,19 +34,19 @@
|
||||
|
||||
void menu_spindle_laser() {
|
||||
|
||||
const bool can_disable = cutter.enabled() && cutter.isOn;
|
||||
const bool is_enabled = cutter.enabled() && cutter.isReady;
|
||||
|
||||
START_MENU();
|
||||
BACK_ITEM(MSG_MAIN);
|
||||
|
||||
#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; }
|
||||
);
|
||||
// Change the cutter's "current power" value without turning the cutter on or off
|
||||
// Power is displayed and set in units and range according to CUTTER_POWER_UNIT
|
||||
EDIT_ITEM_FAST(CUTTER_MENU_POWER_TYPE, MSG_CUTTER(POWER), &cutter.menuPower,
|
||||
cutter.mpower_min(), cutter.mpower_max(), cutter.update_from_mpower);
|
||||
#endif
|
||||
|
||||
if (can_disable)
|
||||
if (is_enabled)
|
||||
ACTION_ITEM(MSG_CUTTER(OFF), cutter.disable);
|
||||
else {
|
||||
ACTION_ITEM(MSG_CUTTER(ON), cutter.enable_forward);
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
#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();});
|
||||
EDIT_ITEM_FAST(CUTTER_MENU_FREQUENCY_TYPE, MSG_CUTTER_FREQUENCY, &cutter.frequency, 2000, 50000, cutter.refresh_frequency);
|
||||
#endif
|
||||
#endif
|
||||
END_MENU();
|
||||
|
Reference in New Issue
Block a user