Browse Source

Merge pull request #3936 from thinkyhead/rc_sav_mk1

Support for SAV_3DGLCD OLED LCD controller
pull/1/head
Scott Lahteine 9 years ago
parent
commit
1a01a44a94
  1. 18
      Marlin/Conditionals.h
  2. 7
      Marlin/Configuration.h
  3. 4
      Marlin/Marlin_main.cpp
  4. 8
      Marlin/configuration_store.cpp
  5. 5
      Marlin/dogm_lcd_implementation.h
  6. 7
      Marlin/example_configurations/Felix/Configuration.h
  7. 7
      Marlin/example_configurations/Felix/DUAL/Configuration.h
  8. 7
      Marlin/example_configurations/Hephestos/Configuration.h
  9. 7
      Marlin/example_configurations/Hephestos_2/Configuration.h
  10. 7
      Marlin/example_configurations/K8200/Configuration.h
  11. 7
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  12. 7
      Marlin/example_configurations/RigidBot/Configuration.h
  13. 7
      Marlin/example_configurations/SCARA/Configuration.h
  14. 7
      Marlin/example_configurations/TAZ4/Configuration.h
  15. 7
      Marlin/example_configurations/WITBOX/Configuration.h
  16. 7
      Marlin/example_configurations/adafruit/ST7565/Configuration.h
  17. 7
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  18. 7
      Marlin/example_configurations/delta/generic/Configuration.h
  19. 7
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  20. 7
      Marlin/example_configurations/delta/kossel_pro/Configuration.h
  21. 7
      Marlin/example_configurations/delta/kossel_xl/Configuration.h
  22. 7
      Marlin/example_configurations/makibox/Configuration.h
  23. 7
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  24. 8
      Marlin/ultralcd.cpp

18
Marlin/Conditionals.h

@ -74,13 +74,13 @@
#define ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_STEPS_PER_MENU_ITEM 1
#endif #endif
// Generic support for SSD1306 OLED based LCDs. // Generic support for SSD1306 / SH1106 OLED based LCDs.
#if ENABLED(U8GLIB_SSD1306) #if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SH1106)
#define ULTRA_LCD //general LCD support, also 16x2 #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 #endif
#if ENABLED(PANEL_ONE) #if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
#define ULTIMAKERCONTROLLER #define ULTIMAKERCONTROLLER
#endif #endif
@ -245,16 +245,10 @@
* Default LCD contrast for dogm-like LCD displays * Default LCD contrast for dogm-like LCD displays
*/ */
#if ENABLED(DOGLCD) #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 #define DEFAULT_LCD_CONTRAST 32
#endif #endif
#define HAS_LCD_CONTRAST
#if ENABLED(U8GLIB_ST7920)
#undef HAS_LCD_CONTRAST
#endif
#if ENABLED(U8GLIB_SSD1306)
#undef HAS_LCD_CONTRAST
#endif
#endif #endif
#else // CONFIGURATION_LCD #else // CONFIGURATION_LCD

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

4
Marlin/Marlin_main.cpp

@ -5628,7 +5628,7 @@ inline void gcode_M226() {
#endif // CHDK || PHOTOGRAPH_PIN #endif // CHDK || PHOTOGRAPH_PIN
#if ENABLED(HAS_LCD_CONTRAST) #if HAS_LCD_CONTRAST
/** /**
* M250: Read and optionally set the LCD contrast * M250: Read and optionally set the LCD contrast
@ -6979,7 +6979,7 @@ void process_next_command() {
break; break;
#endif // CHDK || PHOTOGRAPH_PIN #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) case 250: // M250 Set LCD contrast value: C<value> (value 0..63)
gcode_M250(); gcode_M250();
break; break;

8
Marlin/configuration_store.cpp

@ -282,7 +282,7 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, thermalManager.bedKd); EEPROM_WRITE_VAR(i, thermalManager.bedKd);
#endif #endif
#if DISABLED(HAS_LCD_CONTRAST) #if !HAS_LCD_CONTRAST
const int lcd_contrast = 32; const int lcd_contrast = 32;
#endif #endif
EEPROM_WRITE_VAR(i, lcd_contrast); 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 for (uint8_t q=3; q--;) EEPROM_READ_VAR(i, dummy); // bedKp, bedKi, bedKd
#endif #endif
#if DISABLED(HAS_LCD_CONTRAST) #if !HAS_LCD_CONTRAST
int lcd_contrast; int lcd_contrast;
#endif #endif
EEPROM_READ_VAR(i, lcd_contrast); EEPROM_READ_VAR(i, lcd_contrast);
@ -579,7 +579,7 @@ void Config_ResetDefault() {
absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED; absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
#endif #endif
#if ENABLED(HAS_LCD_CONTRAST) #if HAS_LCD_CONTRAST
lcd_contrast = DEFAULT_LCD_CONTRAST; lcd_contrast = DEFAULT_LCD_CONTRAST;
#endif #endif
@ -842,7 +842,7 @@ void Config_PrintSettings(bool forReplay) {
#endif // PIDTEMP || PIDTEMPBED #endif // PIDTEMP || PIDTEMPBED
#if ENABLED(HAS_LCD_CONTRAST) #if HAS_LCD_CONTRAST
CONFIG_ECHO_START; CONFIG_ECHO_START;
if (!forReplay) { if (!forReplay) {
SERIAL_ECHOLNPGM("LCD Contrast:"); SERIAL_ECHOLNPGM("LCD Contrast:");

5
Marlin/dogm_lcd_implementation.h

@ -150,7 +150,10 @@
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
#elif ENABLED(U8GLIB_SSD1306) #elif ENABLED(U8GLIB_SSD1306)
// Generic support for SSD1306 OLED I2C LCDs // 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) #elif ENABLED(MINIPANEL)
// The MINIPanel display // The MINIPanel display
U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

7
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 //#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 // CONTROLLER TYPE: Shift register panels
// //

8
Marlin/ultralcd.cpp

@ -97,7 +97,7 @@ static void lcd_status_screen();
static void lcd_control_motion_menu(); static void lcd_control_motion_menu();
static void lcd_control_volumetric_menu(); static void lcd_control_volumetric_menu();
#if ENABLED(HAS_LCD_CONTRAST) #if HAS_LCD_CONTRAST
static void lcd_set_contrast(); static void lcd_set_contrast();
#endif #endif
@ -1352,7 +1352,7 @@ static void lcd_control_menu() {
MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu); MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_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_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast); MENU_ITEM(submenu, MSG_CONTRAST, lcd_set_contrast);
#endif #endif
@ -1712,7 +1712,7 @@ static void lcd_control_volumetric_menu() {
* "Control" > "Contrast" submenu * "Control" > "Contrast" submenu
* *
*/ */
#if ENABLED(HAS_LCD_CONTRAST) #if HAS_LCD_CONTRAST
static void lcd_set_contrast() { static void lcd_set_contrast() {
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
@ -2383,7 +2383,7 @@ void lcd_setalertstatuspgm(const char* message) {
void lcd_reset_alert_level() { lcd_status_message_level = 0; } 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) { void lcd_setcontrast(uint8_t value) {
lcd_contrast = value & 0x3F; lcd_contrast = value & 0x3F;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);

Loading…
Cancel
Save