From 7f93173659dd31f87599c7ef4f9352bccdeecd95 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Sun, 27 Sep 2020 23:22:08 -0300 Subject: [PATCH] LVGL followup fixing "C", etc. (#19517) --- Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h | 8 ++++---- Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h | 2 +- .../src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 09e39d841..ddc9ea627 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -21,10 +21,6 @@ */ #pragma once -#ifdef __cplusplus - extern "C" { /* C-declarations for C++ */ -#endif - #include #include @@ -168,6 +164,10 @@ #endif // ifdef TFT35 +#ifdef __cplusplus + extern "C" { /* C-declarations for C++ */ +#endif + extern char public_buf_m[100]; extern char public_buf_l[30]; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h index b1bd88a60..5d5227c2a 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/pic_manager.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfig.h" #include "../../../../libs/W25Qxx.h" diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index af292db7d..c2ff2c436 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -408,7 +408,7 @@ void SysTick_Callback() { OUT_WRITE(LCD_BACKLIGHT_PIN, LOW); LCD_Clear(0x0000); - lcd_draw_logo(); + TERN_(HAS_LOGO_IN_FLASH, lcd_draw_logo()); OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); delay(2000); @@ -724,6 +724,7 @@ lv_fs_res_t sd_open_cb (lv_fs_drv_t * drv, void * file_p, const char * path, lv_ if (temp) { strcpy(temp,".GCO"); } sd_read_base_addr = lv_open_gcode_file((char *)name_buf); sd_read_addr_offset = sd_read_base_addr; + if (sd_read_addr_offset == 0) return LV_FS_RES_NOT_EX; return LV_FS_RES_OK; }