Skip to content

Commit

Permalink
Bool items are wanted?
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 2, 2020
1 parent 1ab193f commit de57732
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions Marlin/src/lcd/language/language_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,12 @@ namespace Language_en {

PROGMEM Language_Str MSG_CUTTER_FREQUENCY = _UxGT("Frequency");
PROGMEM Language_Str MSG_LASER_MENU = _UxGT("Laser Control");
PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power");
PROGMEM Language_Str MSG_LASER_STATE = _UxGT("Laser State");
PROGMEM Language_Str MSG_SPINDLE_STATE = _UxGT("Spindle State");
PROGMEM Language_Str MSG_SPINDLE_MENU = _UxGT("Spindle Control");
PROGMEM Language_Str MSG_LASER_POWER = _UxGT("Laser Power");
PROGMEM Language_Str MSG_SPINDLE_POWER = _UxGT("Spindle Power");
PROGMEM Language_Str MSG_LASER_TOGGLE = _UxGT("Toggle Laser");
PROGMEM Language_Str MSG_SPINDLE_TOGGLE = _UxGT("Toggle Spindle");
PROGMEM Language_Str MSG_SPINDLE_FORWARD = _UxGT("Spindle Forward");
PROGMEM Language_Str MSG_SPINDLE_REVERSE = _UxGT("Spindle Reverse");

PROGMEM Language_Str MSG_SWITCH_PS_ON = _UxGT("Switch Power On");
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/menu/menu_spindle_laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "../../feature/spindle_laser.h"

void menu_spindle_laser() {
const bool is_enabled = cutter.enabled() && cutter.isReady;
bool is_enabled = cutter.enabled() && cutter.isReady;

START_MENU();
BACK_ITEM(MSG_MAIN);
Expand All @@ -46,13 +46,13 @@
#endif

if (is_enabled)
ACTION_ITEM(MSG_CUTTER(STATE), cutter.disable);
EDIT_ITEM(bool, MSG_CUTTER(SWITCH), &is_enabled, cutter.disable);
else {
#if ENABLED(SPINDLE_CHANGE_DIR)
ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable_forward);
ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable_reverse);
EDIT_ITEM(bool, MSG_CUTTER(FORWARD), &is_enabled, cutter.enable_forward);
EDIT_ITEM(bool, MSG_CUTTER(REVERSE), &is_enabled, cutter.enable_reverse);
#else

This comment has been minimized.

Copy link
@descipher

descipher Dec 2, 2020

Contributor

This needs to be #endif

ACTION_ITEM(MSG_CUTTER(STATE), cutter.enable);
EDIT_ITEM(bool, MSG_CUTTER(SWITCH), &is_enabled, cutter.enable);
#endif
}

Expand Down

3 comments on commit de57732

@descipher
Copy link
Contributor

Choose a reason for hiding this comment

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

Right, need to pull and test that.

@descipher
Copy link
Contributor

Choose a reason for hiding this comment

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

cutter.enabled is not defined

@descipher
Copy link
Contributor

@descipher descipher commented on de57732 Dec 2, 2020

Choose a reason for hiding this comment

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

The original code I found only turns cutter on in forward or reverse without an enable function. so enable is not required. State does not work well in the spindle mode unless forward and reverse only change dir separately e.g. pin 5 polarity. There really wasn't an clear on/off call, it was combined with forward/reverse.

Please sign in to comment.