Skip to content

Commit

Permalink
Restore original M250.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
petrzmax committed Dec 30, 2019
1 parent dc64a33 commit 1387145
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions Marlin/src/gcode/lcd/M250.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,17 @@

#include "../../inc/MarlinConfig.h"

#if HAS_LCD_CONTRAST || TFT_HAS_COLOR
#if HAS_LCD_CONTRAST

#include "../gcode.h"
#include "../../lcd/ultralcd.h"
#include "../../lcd/dogm/ultralcd_DOGM.h"

/**
* M250: Read and optionally set the LCD contrast
*/
void GcodeSuite::M250() {

#if HAS_LCD_CONTRAST
if (parser.seen('C')) ui.set_contrast(parser.value_int());
SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast);
#endif // HAS_LCD_CONTRAST

//
// Warning this component is still pretty stupid
//

#if TFT_HAS_COLOR
if (parser.seen('B'))
{
bg_color = parser.value_ushort();
SERIAL_ECHOLNPAIR("TFT Background Color: ", bg_color);
}

if (parser.seen('F'))
{
ui_color = parser.value_ushort();
SERIAL_ECHOLNPAIR("TFT Foreground Color: ", ui_color);
}

if (parser.seen('P'))
{
switchColorPreset(parser.value_byte());
SERIAL_ECHOLN("Switched Color Preset: ");
}
#endif // TFT_HAS_COLOR

if (parser.seen('C')) ui.set_contrast(parser.value_int());
SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast);
}

#endif // HAS_LCD_CONTRAST || TFT_HAS_COLOR
#endif // HAS_LCD_CONTRAST

0 comments on commit 1387145

Please sign in to comment.