diff --git a/Marlin/AO_FT810_Constants.h b/Marlin/AO_FT810_Constants.h index e7904e630..7b19e7b7f 100644 --- a/Marlin/AO_FT810_Constants.h +++ b/Marlin/AO_FT810_Constants.h @@ -628,14 +628,14 @@ namespace FTDI { const uint32_t CMD_LOGO = 0xFFFFFF31; } -// If IS_FT800 is defined, then copy the FT800 namespace into the FTDI namespace -// If IS_FT810 is defined, then copy the FT810 namespace into the FTDI namespace +// If LCD_IS_FT800 is defined, then copy the FT800 namespace into the FTDI namespace +// If LCD_IS_FT810 is defined, then copy the FT810 namespace into the FTDI namespace -#if defined(IS_FT800) +#if defined(LCD_IS_FT800) namespace FTDI { using namespace FT800; } -#elif defined(IS_FT810) +#elif defined(LCD_IS_FT810) namespace FTDI { using namespace FT810; } diff --git a/Marlin/AO_FT810_Functions.h b/Marlin/AO_FT810_Functions.h index 480fdb854..9eec2e186 100644 --- a/Marlin/AO_FT810_Functions.h +++ b/Marlin/AO_FT810_Functions.h @@ -105,7 +105,7 @@ #ifndef _AO_FT810_FUNC_H #define _AO_FT810_FUNC_H -#if defined(IS_FT800) +#if defined(LCD_IS_FT800) #define DL_CACHE_START 0x035000 #else #define DL_CACHE_START 0x0F5000 @@ -116,7 +116,7 @@ #if defined(LCD_800x480) using namespace FTDI_LCD_800x480; -#else +#elif defined(LCD_480x272) using namespace FTDI_LCD_480x272; #endif @@ -165,7 +165,7 @@ class CLCD { static uint32_t getRegCmdWrite(); static uint32_t getRegCmdRead(); - #if defined(IS_FT800) + #if defined(LCD_IS_FT800) static uint32_t command_write_ptr; template void _write_unaligned(T data, uint16_t len); #else @@ -343,7 +343,7 @@ void CLCD::Init (void) { * If driving the 4D Systems 4DLCD-FT843 Board, the following Init sequence is needed for its FT800 Driver */ -#ifdef IS_FT800 // Use External Crystal and 48 MHz System Clock +#ifdef LCD_IS_FT800 // Use External Crystal and 48 MHz System Clock Host_Cmd(CLKEXT, 0); delay(20); @@ -421,7 +421,7 @@ void CLCD::Init (void) { /* * Turn On the Display */ - #if defined(IS_FT800) + #if defined(LCD_IS_FT800) Mem_Write8(REG_GPIO_DIR, 0x80); // Turn ON Display Enable Mem_Write8(REG_GPIO, 0x80); #else @@ -447,7 +447,7 @@ void CLCD::Init (void) { /******************* FT800/810 Graphic Commands *********************************/ -#if defined(IS_FT800) +#if defined(LCD_IS_FT800) uint32_t CLCD::CommandFifo::command_write_ptr = 0xFFFFFFFFul; #endif diff --git a/Marlin/AO_FT810_SPI.h b/Marlin/AO_FT810_SPI.h index 20a0ea267..72180324c 100644 --- a/Marlin/AO_FT810_SPI.h +++ b/Marlin/AO_FT810_SPI.h @@ -278,7 +278,7 @@ void CLCD::CommandFifo::Cmd_Wait_Until_Idle() { } while(!Cmd_Is_Idle()); } -#if defined(IS_FT800) +#if defined(LCD_IS_FT800) void CLCD::CommandFifo::Cmd_Start() { if(command_write_ptr == 0xFFFFFFFFul) { command_write_ptr = getRegCmdWrite(); diff --git a/Marlin/AO_FT810_UI_Bitmaps.h b/Marlin/AO_FT810_UI_Bitmaps.h index 98766675f..5e38e9d2f 100644 --- a/Marlin/AO_FT810_UI_Bitmaps.h +++ b/Marlin/AO_FT810_UI_Bitmaps.h @@ -142,7 +142,7 @@ const PROGMEM CLCD::bitmap_info_t TD_Icon_Info = { .filter = BILINEAR, .wrapx = BORDER, .wrapy = BORDER, - .RAMG_addr = RAM_G + 8400, + .RAMG_addr = RAM_G + 9000, .width = 50, .height = 20, }; diff --git a/Marlin/AO_FT810_UI_Screens.h b/Marlin/AO_FT810_UI_Screens.h index e73559953..596839a6f 100644 --- a/Marlin/AO_FT810_UI_Screens.h +++ b/Marlin/AO_FT810_UI_Screens.h @@ -924,20 +924,29 @@ void ValueAdjusters::draw_increment_btn(const uint8_t tag, uint8_t decimals) { uint8_t pos; switch(tag) { - case 20: label = PSTR("0.001"); pos = decimals - 3; break; - case 21: label = PSTR( "0.01"); pos = decimals - 2; break; + case 20: label = PSTR( ".001"); pos = decimals - 3; break; + case 21: label = PSTR( ".01"); pos = decimals - 2; break; case 22: label = PSTR( "0.1"); pos = decimals - 1; break; case 23: label = PSTR( "1" ); pos = decimals + 0; break; case 24: label = PSTR( "10" ); pos = decimals + 1; break; case 25: label = PSTR("100" ); pos = decimals + 2; break; + default: + #if defined(UI_FRAMEWORK_DEBUG) + #if defined(SERIAL_PROTOCOLLNPAIR) + SERIAL_PROTOCOLLNPAIR("Unknown tag for increment btn: ", tag); + #else + Serial.print(F("Unknown tag for increment btn:")); + Serial.println(tag); + #endif + #endif } BTN_TAG(tag) switch(pos) { #if defined(LCD_PORTRAIT) - case 0: BTN( BTN_POS(2,8), BTN_SIZE(1,1), progmem_str(label), FONT_MED, OPT_3D); break; - case 1: BTN( BTN_POS(3,8), BTN_SIZE(1,1), progmem_str(label), FONT_MED, OPT_3D); break; - case 2: BTN( BTN_POS(4,8), BTN_SIZE(1,1), progmem_str(label), FONT_MED, OPT_3D); break; + case 0: BTN( BTN_POS(3,8), BTN_SIZE(1,1), progmem_str(label), FONT_SML, OPT_3D); break; + case 1: BTN( BTN_POS(4,8), BTN_SIZE(1,1), progmem_str(label), FONT_SML, OPT_3D); break; + case 2: BTN( BTN_POS(5,8), BTN_SIZE(1,1), progmem_str(label), FONT_SML, OPT_3D); break; #else case 0: BTN( BTN_POS(8,2), BTN_SIZE(2,1), progmem_str(label), FONT_MED, OPT_3D); break; case 1: BTN( BTN_POS(8,3), BTN_SIZE(2,1), progmem_str(label), FONT_MED, OPT_3D); break; @@ -956,16 +965,15 @@ void ValueAdjusters::heading_t::static_parts() const { draw_increment_btn(23 - decimals, decimals); draw_increment_btn(24 - decimals, decimals); draw_increment_btn(25 - decimals, decimals); - draw_increment_btn(26 - decimals, decimals); #if defined(LCD_PORTRAIT) - BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(1,1), BTN_SIZE(6,1), heading, FONT_MED, OPT_FLAT); - BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(1,7), BTN_SIZE(6,1), F("Increment:"), FONT_SML, OPT_FLAT); + BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(1,1), BTN_SIZE(6,1), (progmem_str) label, FONT_MED, OPT_FLAT); + BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(1,7), BTN_SIZE(6,1), F("Increment:"), FONT_MED, OPT_FLAT); BTN_TAG(1) THEME(navi_btn) BTN( BTN_POS(1,10), BTN_SIZE(6,1), F("Back"), MENU_BTN_STYLE); #else BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(3,1), BTN_SIZE(4,1), (progmem_str) label, FONT_MED, OPT_FLAT); BTN_TAG(0) THEME(adjust_bg) BTN( BTN_POS(8,1), BTN_SIZE(2,1), F("Increment"), FONT_MED, OPT_FLAT); - BTN_TAG(1) THEME(navi_btn) BTN( BTN_POS(7,6), BTN_SIZE(3,1), F("Back"), MENU_BTN_STYLE); + BTN_TAG(1) THEME(navi_btn) BTN( BTN_POS(8,6), BTN_SIZE(2,1), F("Back"), MENU_BTN_STYLE); #endif } @@ -1139,7 +1147,7 @@ void StepsScreen::onRefresh() { const adjuster_t b = {1, PSTR("X:"), PSTR(""), Theme::x_axis, 0}; const adjuster_t c = {2, PSTR("Y:"), PSTR(""), Theme::y_axis, 0}; const adjuster_t d = {3, PSTR("Z:"), PSTR(""), Theme::z_axis, 0}; - const adjuster_t e = {4, PSTR("E:"), PSTR(""), Theme::z_axis, 0}; + const adjuster_t e = {4, PSTR("E:"), PSTR(""), Theme::e_axis, 0}; if(dlcache.hasData()) { dlcache.append(); diff --git a/Marlin/Conditionals_LulzBot.h b/Marlin/Conditionals_LulzBot.h index ab20b058b..7e858e235 100644 --- a/Marlin/Conditionals_LulzBot.h +++ b/Marlin/Conditionals_LulzBot.h @@ -130,6 +130,7 @@ #define LULZBOT_USE_EINSYRAMBO #define LULZBOT_USE_EINSY_RETRO #define LULZBOT_USE_TOUCH_UI + #define LULZBOT_USE_HIGH_RES #define LULZBOT_TWO_PIECE_BED #define LULZBOT_USE_AUTOLEVELING #define LULZBOT_SENSORLESS_HOMING @@ -168,6 +169,7 @@ #define LULZBOT_TAZ_BED #define LULZBOT_TWO_PIECE_BED #define LULZBOT_USE_TOUCH_UI + #define LULZBOT_USE_HIGH_RES #define LULZBOT_USE_AUTOLEVELING #define LULZBOT_USE_MIN_ENDSTOPS #define LULZBOT_USE_MAX_ENDSTOPS @@ -1916,8 +1918,18 @@ #endif #if defined(LULZBOT_USE_TOUCH_UI) -extern void lcd_update(); -extern void lcd_buttons_update(); + extern void lcd_update(); + extern void lcd_buttons_update(); + //#define LCD_IS_FT800 + #define LCD_IS_FT810 + #if defined(LULZBOT_USE_HIGH_RES) + #define LCD_800x480 + #else + #define LCD_480x272 + #endif + #define LCD_PORTRAIT + #define LCD_UPSIDE_DOWN + #define UI_FRAMEWORK_DEBUG #endif /***************************** CUSTOM SPLASH SCREEN *****************************/ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c89e60ad..ceaae9679 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -349,20 +349,14 @@ #endif #if defined(LULZBOT_USE_TOUCH_UI) -#define IS_FT800 -//#define IS_FT810 -//#define LCD_PORTRAIT -//#define LCD_UPSIDE_DOWN -//#define LCD_800x480 -#define UI_FRAMEWORK_DEBUG -#include "AO_UI_Marlin_LCD_API.h" -#include "AO_UI_Framework.h" -#include "AO_FT810_Constants.h" -#include "AO_FT810_Functions.h" -#include "AO_FT810_Pins.h" -#include "AO_FT810_SPI.h" -#include "AO_FT810_UI_Bitmaps.h" -#include "AO_FT810_UI_Screens.h" + #include "AO_UI_Marlin_LCD_API.h" + #include "AO_UI_Framework.h" + #include "AO_FT810_Constants.h" + #include "AO_FT810_Functions.h" + #include "AO_FT810_Pins.h" + #include "AO_FT810_SPI.h" + #include "AO_FT810_UI_Bitmaps.h" + #include "AO_FT810_UI_Screens.h" #endif bool Running = true; diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index a8ca159fb..ed7b101f3 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -185,7 +185,9 @@ extern uint8_t progress_bar_percent; #endif -#elif !defined(LULZBOT_USE_TOUCH_UI) // no LCD +#elif defined(LULZBOT_USE_TOUCH_UI) + // We will use our own definitions for these functions. +#else // no LCD inline void lcd_update() {} inline void lcd_init() {} inline bool lcd_hasstatus() { return false; }