From aa1d587128e1bfbf09e9c27dc19ac5ebaf496713 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Mar 2019 05:07:14 -0500 Subject: [PATCH] Some LCD code cleanup --- .../u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp | 2 - Marlin/src/inc/Conditionals_LCD.h | 6 +- Marlin/src/inc/Conditionals_post.h | 4 +- .../lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp | 2 +- .../lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp | 2 +- .../lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp | 68 +++++++++---------- config/examples/Mks/Sbase/Configuration_adv.h | 7 -- 7 files changed, 39 insertions(+), 52 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp index 4495e7f7e..aad3603ad 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp @@ -26,8 +26,6 @@ * COM interface for Arduino (AND ATmega) and the SSDxxxx chip (SOLOMON) variant * I2C protocol * - * ToDo: Rename this to u8g_com_avr_ssd_i2c.c - * * Universal 8bit Graphics Library * * Copyright (c) 2011, olikraus@gmail.com diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index f30f5a927..efc91ea67 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -66,9 +66,9 @@ #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(AZSMZ_12864) - #define ULTRA_LCD //general LCD support, also 16x2 - #define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family) - #define ULTIMAKERCONTROLLER //as available from the Ultimaker online store. + #define ULTRA_LCD + #define DOGLCD + #define ULTIMAKERCONTROLLER #if ENABLED(miniVIKI) #define LCD_CONTRAST_MIN 75 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ef5ed50c6..7a75b4784 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1544,9 +1544,9 @@ #endif /** - * VIKI2, miniVIKI, AZSMZ_12864, and MKS_12864OLED_SSD1306 require DOGLCD_SCK and DOGLCD_MOSI to be defined. + * Make sure DOGLCD_SCK and DOGLCD_MOSI are defined. */ -#if ENABLED(VIKI2) || ENABLED(miniVIKI) || ENABLED(AZSMZ_12864) || ENABLED(MKS_12864OLED_SSD1306) +#if ENABLED(DOGLCD) #ifndef DOGLCD_SCK #define DOGLCD_SCK SCK_PIN #endif diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp index 17d93e9a2..089a268f1 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp @@ -21,7 +21,7 @@ */ /** - * u8g_dev_st7565_64128n_HAL.c (Displaytech) + * Based on u8g_dev_st7565_64128n_HAL.c (Displaytech) * * Universal 8bit Graphics Library * diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp index ed5036f30..4c34f8209 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp @@ -21,7 +21,7 @@ */ /** - * u8g_dev_st7920_128x64_HAL.c + * Based on u8g_dev_st7920_128x64.c * * Universal 8bit Graphics Library * diff --git a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp index 84adc25b4..35f7d4161 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_uc1701_mini12864_HAL.cpp @@ -20,42 +20,38 @@ * */ - -/* - - based on u8g_dev_uc1701_mini12864_HAL.c (dealextreme) - - Universal 8bit Graphics Library - - Copyright (c) 2011, olikraus@gmail.com - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -*/ +/** + * Based on u8g_dev_uc1701_mini12864.c (dealextreme) + * + * Universal 8bit Graphics Library + * + * Copyright (c) 2011, olikraus@gmail.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this list + * of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #include "../../inc/MarlinConfigPre.h" diff --git a/config/examples/Mks/Sbase/Configuration_adv.h b/config/examples/Mks/Sbase/Configuration_adv.h index 4c9893047..adab576c0 100644 --- a/config/examples/Mks/Sbase/Configuration_adv.h +++ b/config/examples/Mks/Sbase/Configuration_adv.h @@ -918,13 +918,6 @@ // Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE - - // VIKI2 and miniVIKI require DOGLCD_SCK and DOGLCD_MOSI to be defined. - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN - #endif - /** * ST7920-based LCDs can emulate a 16 x 4 character display using * the ST7920 character-generator for very fast screen updates.