Skip to content

Commit

Permalink
Merge pull request #3936 from thinkyhead/rc_sav_mk1
Browse files Browse the repository at this point in the history
Support for SAV_3DGLCD OLED LCD controller
  • Loading branch information
thinkyhead committed Jun 1, 2016
2 parents 4770d7c + a0b000d commit 1a01a44
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 23 deletions.
18 changes: 6 additions & 12 deletions Marlin/Conditionals.h
Expand Up @@ -74,13 +74,13 @@
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif

// Generic support for SSD1306 OLED based LCDs.
#if ENABLED(U8GLIB_SSD1306)
// Generic support for SSD1306 / SH1106 OLED based LCDs.
#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
#define ULTRA_LCD //general LCD support, also 16x2
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family)
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SH1106 graphic Display Family)
#endif

#if ENABLED(PANEL_ONE)
#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
#define ULTIMAKERCONTROLLER
#endif

Expand Down Expand Up @@ -245,16 +245,10 @@
* Default LCD contrast for dogm-like LCD displays
*/
#if ENABLED(DOGLCD)
#if !defined(DEFAULT_LCD_CONTRAST)
#define HAS_LCD_CONTRAST (DISABLED(U8GLIB_ST7920) && DISABLED(U8GLIB_SSD1306) && DISABLED(U8GLIB_SH1106))
#if HAS_LCD_CONTRAST && !defined(DEFAULT_LCD_CONTRAST)
#define DEFAULT_LCD_CONTRAST 32
#endif
#define HAS_LCD_CONTRAST
#if ENABLED(U8GLIB_ST7920)
#undef HAS_LCD_CONTRAST
#endif
#if ENABLED(U8GLIB_SSD1306)
#undef HAS_LCD_CONTRAST
#endif
#endif

#else // CONFIGURATION_LCD
Expand Down
7 changes: 7 additions & 0 deletions Marlin/Configuration.h
Expand Up @@ -1063,6 +1063,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
4 changes: 2 additions & 2 deletions Marlin/Marlin_main.cpp
Expand Up @@ -5628,7 +5628,7 @@ inline void gcode_M226() {

#endif // CHDK || PHOTOGRAPH_PIN

#if ENABLED(HAS_LCD_CONTRAST)
#if HAS_LCD_CONTRAST

/**
* M250: Read and optionally set the LCD contrast
Expand Down Expand Up @@ -6979,7 +6979,7 @@ void process_next_command() {
break;
#endif // CHDK || PHOTOGRAPH_PIN

#if ENABLED(HAS_LCD_CONTRAST)
#if HAS_LCD_CONTRAST
case 250: // M250 Set LCD contrast value: C<value> (value 0..63)
gcode_M250();
break;
Expand Down
8 changes: 4 additions & 4 deletions Marlin/configuration_store.cpp
Expand Up @@ -282,7 +282,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, thermalManager.bedKd);
#endif

#if DISABLED(HAS_LCD_CONTRAST)
#if !HAS_LCD_CONTRAST
const int lcd_contrast = 32;
#endif
EEPROM_WRITE_VAR(i, lcd_contrast);
Expand Down Expand Up @@ -462,7 +462,7 @@ void Config_RetrieveSettings() {
for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // bedKp, bedKi, bedKd
#endif

#if DISABLED(HAS_LCD_CONTRAST)
#if !HAS_LCD_CONTRAST
int lcd_contrast;
#endif
EEPROM_READ_VAR(i, lcd_contrast);
Expand Down Expand Up @@ -579,7 +579,7 @@ void Config_ResetDefault() {
absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
#endif

#if ENABLED(HAS_LCD_CONTRAST)
#if HAS_LCD_CONTRAST
lcd_contrast = DEFAULT_LCD_CONTRAST;
#endif

Expand Down Expand Up @@ -842,7 +842,7 @@ void Config_PrintSettings(bool forReplay) {

#endif // PIDTEMP || PIDTEMPBED

#if ENABLED(HAS_LCD_CONTRAST)
#if HAS_LCD_CONTRAST
CONFIG_ECHO_START;
if (!forReplay) {
SERIAL_ECHOLNPGM("LCD Contrast:");
Expand Down
5 changes: 4 additions & 1 deletion Marlin/dogm_lcd_implementation.h
Expand Up @@ -150,7 +150,10 @@
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
#elif ENABLED(U8GLIB_SSD1306)
// Generic support for SSD1306 OLED I2C LCDs
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST);
#elif ENABLED(U8GLIB_SH1106)
// Generic support for SH1106 OLED I2C LCDs
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST);
#elif ENABLED(MINIPANEL)
// The MINIPanel display
U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/Felix/Configuration.h
Expand Up @@ -1046,6 +1046,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/Felix/DUAL/Configuration.h
Expand Up @@ -1044,6 +1044,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/Hephestos/Configuration.h
Expand Up @@ -1055,6 +1055,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/Hephestos_2/Configuration.h
Expand Up @@ -1057,6 +1057,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/K8200/Configuration.h
Expand Up @@ -1080,6 +1080,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
Expand Up @@ -1063,6 +1063,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/RigidBot/Configuration.h
Expand Up @@ -1060,6 +1060,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/SCARA/Configuration.h
Expand Up @@ -1071,6 +1071,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/TAZ4/Configuration.h
Expand Up @@ -1084,6 +1084,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/WITBOX/Configuration.h
Expand Up @@ -1055,6 +1055,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/adafruit/ST7565/Configuration.h
Expand Up @@ -1063,6 +1063,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/delta/biv2.5/Configuration.h
Expand Up @@ -1192,6 +1192,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/delta/generic/Configuration.h
Expand Up @@ -1192,6 +1192,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
Expand Up @@ -1196,6 +1196,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
Expand Up @@ -1189,6 +1189,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/delta/kossel_xl/Configuration.h
Expand Up @@ -1197,6 +1197,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/makibox/Configuration.h
Expand Up @@ -1066,6 +1066,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down
7 changes: 7 additions & 0 deletions Marlin/example_configurations/tvrrug/Round2/Configuration.h
Expand Up @@ -1057,6 +1057,13 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo
//
//#define U8GLIB_SSD1306

// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules
//#define SAV_3DGLCD
#if ENABLED(SAV_3DGLCD)
//#define U8GLIB_SSD1306
#define U8GLIB_SH1106
#endif

//
// CONTROLLER TYPE: Shift register panels
//
Expand Down

0 comments on commit 1a01a44

Please sign in to comment.