Skip to content

Menu entry for toggling case light#5243

Closed
Kaibob2 wants to merge 7 commits intoMarlinFirmware:RCBugFixfrom
Kaibob2:Case-Light-entry
Closed

Menu entry for toggling case light#5243
Kaibob2 wants to merge 7 commits intoMarlinFirmware:RCBugFixfrom
Kaibob2:Case-Light-entry

Conversation

@Kaibob2
Copy link
Contributor

@Kaibob2 Kaibob2 commented Nov 17, 2016

Referenced to this #5194 i implemented a (definable) Menu entry on the main screen to toggle the case lights. I had this long before the #define CASE_LIGHT_PIN 4 and always found it extremely useful to be able to switch off the case light from by LCD. The host is shut down most of the time, so if #define CASE_LIGHT_DEFAULT_ON is enabled there is no way to switch of the case light if the printer is printing for 20 hours.

#else
;
;
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Oops. Already patched this region.

if (code_seen('S')) {
case_light_on = code_value_bool();
if (case_light_on == 0) caselight = false;
if (case_light_on == 1) caselight = true;
Copy link
Member

@thinkyhead thinkyhead Nov 19, 2016

Choose a reason for hiding this comment

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

This instead:

caselight = case_light_on = code_value_bool();

…or actually, just make case_light_on a global so it can be used by ultralcd.cpp.

#endif
#if HAS_CASE_LIGHT
extern bool caselight;
#endif
Copy link
Member

@thinkyhead thinkyhead Nov 19, 2016

Choose a reason for hiding this comment

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

Instead of two flags for the same thing, just use extern bool case_light_on and make case_light_on a global instead of a static local to gcode_M355.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants