diff --git a/Marlin/Conditionals.h b/Marlin/Conditionals.h index 705036c1f834..599a1bf24bea 100644 --- a/Marlin/Conditionals.h +++ b/Marlin/Conditionals.h @@ -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 @@ -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 diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ae141a642f0a..b67d0a02fc9d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -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 // diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index b3c302d49829..6c4846416354 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -5624,7 +5624,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 @@ -6975,7 +6975,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 0..63) gcode_M250(); break; diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 05a24acfe9c7..001955f6ed57 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -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); @@ -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); @@ -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 @@ -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:"); diff --git a/Marlin/dogm_lcd_implementation.h b/Marlin/dogm_lcd_implementation.h index 89094bb00d0e..b0cd312b0e69 100644 --- a/Marlin/dogm_lcd_implementation.h +++ b/Marlin/dogm_lcd_implementation.h @@ -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); diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 3bacb22eac03..39e5ce4e36ef 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 67b15001864e..107f8386c202 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fd6051945f21..5b41fb397c24 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 3a9e23ce9155..3f6f4b644631 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 95338bd36771..4b74fe505f3c 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 740e0cbb2bf8..d9c8b9be44a4 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index a532d702b3d6..967927d8648b 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 127fc5f87f94..a801823ee731 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 6da5d80c16b1..b2bd2ce8a80f 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 55d2136c1236..f32e071d1d46 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 670bc634602e..151e16bc82ae 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration.h b/Marlin/example_configurations/delta/biv2.5/Configuration.h index 3c4d589a656a..0eb146e02350 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 12e195c5e095..b0ffebf814ff 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index 67a02053deda..b58d89793c6b 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index c03fd2fc614d..73018034de88 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 31aab5a882e7..f8374a8134c5 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 9abfe8db6fb0..1991ee6205a5 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -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 // diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 01b6a064108b..c380ee2a0a96 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -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 // diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 0f7746d296ed..98b5fa665b87 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -97,7 +97,7 @@ static void lcd_status_screen(); static void lcd_control_motion_menu(); static void lcd_control_volumetric_menu(); - #if ENABLED(HAS_LCD_CONTRAST) + #if HAS_LCD_CONTRAST static void lcd_set_contrast(); #endif @@ -1352,7 +1352,7 @@ static void lcd_control_menu() { MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu); - #if ENABLED(HAS_LCD_CONTRAST) + #if HAS_LCD_CONTRAST //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); #endif @@ -1712,7 +1712,7 @@ static void lcd_control_volumetric_menu() { * "Control" > "Contrast" submenu * */ -#if ENABLED(HAS_LCD_CONTRAST) +#if HAS_LCD_CONTRAST static void lcd_set_contrast() { ENCODER_DIRECTION_NORMAL(); if (encoderPosition) { @@ -2383,7 +2383,7 @@ void lcd_setalertstatuspgm(const char* message) { void lcd_reset_alert_level() { lcd_status_message_level = 0; } -#if ENABLED(HAS_LCD_CONTRAST) +#if HAS_LCD_CONTRAST void lcd_setcontrast(uint8_t value) { lcd_contrast = value & 0x3F; u8g.setContrast(lcd_contrast);