Skip to content

Commit

Permalink
Closer to intention
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 2, 2020
1 parent f9ba37f commit 1ab193f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion Marlin/src/feature/spindle_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
SpindleLaser cutter;
uint8_t SpindleLaser::power;
bool SpindleLaser::isReady; // Ready to apply power setting from the UI to OCR
bool SpindleLaser::state; // Cutter/Laser on/off state
cutter_power_t SpindleLaser::menuPower, // Power set via LCD menu in PWM, PERCENT, or RPM
SpindleLaser::unitPower; // LCD status power in PWM, PERCENT, or RPM

Expand Down
1 change: 0 additions & 1 deletion Marlin/src/feature/spindle_laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class SpindleLaser {
static const cutter_power_t mpower_max() { return cpwr_to_upwr(SPEED_POWER_MAX); }

static bool isReady; // Ready to apply power setting from the UI to OCR
static bool state; // Cutter/Laser on/off state
static uint8_t power;

#if ENABLED(MARLIN_DEV_MODE)
Expand Down
12 changes: 9 additions & 3 deletions Marlin/src/lcd/menu/menu_spindle_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@
#endif

if (is_enabled)
EDIT_ITEM(bool, MSG_CUTTER(STATE), &cutter.state, cutter.disable);
else
EDIT_ITEM(bool, MSG_CUTTER(STATE), &cutter.state, TERN(SPINDLE_CHANGE_DIR, cutter.enable_reverse, cutter.enable_forward));
ACTION_ITEM(MSG_CUTTER(STATE), cutter.disable);
else {
#if ENABLED(SPINDLE_CHANGE_DIR)
ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable_forward);
ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable_reverse);
#else
ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable);
#endif
}

#if BOTH(MARLIN_DEV_MODE, 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);
Expand Down

2 comments on commit 1ab193f

@descipher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be:
ACTION_ITEM(MSG_CUTTER(FORWARD), cutter.enable_forward);
ACTION_ITEM(MSG_CUTTER(REVERSE), cutter.enable_reverse);
With the addition of:
PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Spindle Forward");

@descipher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can check the P4,5,6 pin states to see if its correct.

Please sign in to comment.