restructure folders

This commit is contained in:
2023-08-16 16:07:30 +02:00
parent 9ca5968e9f
commit 6aac53cc3b
9 changed files with 23 additions and 22 deletions

View File

@@ -20,12 +20,13 @@ framework = arduino
[env:wt32-sc01_plus] [env:wt32-sc01_plus]
board = wt32-sc01_plus board = wt32-sc01_plus
board_build.partitions = partitions.csv board_build.partitions = partitions.csv
build_src_filter =
+<*> ; include all sources
-<boards/xyz> ; except xyz specific implementations
build_flags = build_flags =
-D CORE_DEBUG_LEVEL=4 -D CORE_DEBUG_LEVEL=4
-D SCREEN_WIDTH=480
-D SCREEN_HEIGHT=320 -D SCREEN_HEIGHT=320
-D ESP32S3 -D ESP32S3
-D WT32SC01PLUS
-D BOARD_HAS_PSRAM -D BOARD_HAS_PSRAM
-D ARDUINO_USB_CDC_ON_BOOT -D ARDUINO_USB_CDC_ON_BOOT
-D LV_CONF_INCLUDE_SIMPLE -D LV_CONF_INCLUDE_SIMPLE

View File

@@ -17,11 +17,11 @@
#define LV_ATTRIBUTE_MEM_ALIGN #define LV_ATTRIBUTE_MEM_ALIGN
#endif #endif
#ifndef LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON_LVGL #ifndef LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON
#define LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON_LVGL #define LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON
#endif #endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON_LVGL uint8_t os_railway_icon_lvgl_map[] = { const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_OS_RAILWAY_ICON uint8_t os_railway_icon_map[] = {
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
/*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff, 0x97, 0xff,
@@ -995,12 +995,12 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_OS_RAILWA
#endif #endif
}; };
const lv_img_dsc_t os_railway_icon_lvgl = { const lv_img_dsc_t os_railway_icon = {
.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA,
.header.always_zero = 0, .header.always_zero = 0,
.header.reserved = 0, .header.reserved = 0,
.header.w = 240, .header.w = 240,
.header.h = 240, .header.h = 240,
.data_size = 57600 * LV_IMG_PX_SIZE_ALPHA_BYTE, .data_size = 57600 * LV_IMG_PX_SIZE_ALPHA_BYTE,
.data = os_railway_icon_lvgl_map, .data = os_railway_icon_map,
}; };

View File

@@ -16,7 +16,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#include "gfx/lgfx.h" #include "boards/lgfx.h"
LGFX::LGFX() LGFX::LGFX()
{ {
@@ -47,8 +47,8 @@ LGFX::LGFX()
cfg.pin_cs = -1; cfg.pin_cs = -1;
cfg.pin_rst = 4; cfg.pin_rst = 4;
cfg.pin_busy = -1; cfg.pin_busy = -1;
cfg.panel_width = SCREEN_HEIGHT; cfg.panel_width = 480;
cfg.panel_height = SCREEN_WIDTH; cfg.panel_height = 320;
cfg.offset_x = 0; cfg.offset_x = 0;
cfg.offset_y = 0; cfg.offset_y = 0;
cfg.offset_rotation = 0; cfg.offset_rotation = 0;
@@ -59,8 +59,8 @@ LGFX::LGFX()
cfg.rgb_order = false; cfg.rgb_order = false;
cfg.dlen_16bit = false; cfg.dlen_16bit = false;
cfg.bus_shared = true; cfg.bus_shared = true;
cfg.memory_width = SCREEN_HEIGHT; cfg.memory_width = 480;
cfg.memory_height = SCREEN_WIDTH; cfg.memory_height = 320;
_panel_instance.config(cfg); _panel_instance.config(cfg);
} }

View File

@@ -16,14 +16,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#include "gfx/lv_setup.h" #include "boards/lv_setup.h"
#include <lvgl.h> #include <lvgl.h>
#include <gfx/lgfx.h>
#include "boards/lgfx.h"
#include "lv_conf.h" #include "lv_conf.h"
#define LV_BUF_SIZE (SCREEN_WIDTH * SCREEN_HEIGHT) #define LV_BUF_SIZE (480 * 320)
LGFX tft; LGFX tft;
@@ -94,8 +94,8 @@ void lv_begin()
static lv_disp_drv_t disp_drv; static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv); lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = SCREEN_WIDTH; disp_drv.hor_res = 480;
disp_drv.ver_res = SCREEN_HEIGHT; disp_drv.ver_res = 320;
disp_drv.flush_cb = flush_cb; disp_drv.flush_cb = flush_cb;
disp_drv.draw_buf = &draw_buf; disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv); lv_disp_drv_register(&disp_drv);

View File

@@ -20,7 +20,7 @@
#include <esp32-hal-log.h> #include <esp32-hal-log.h>
#include "gfx/lv_setup.h" #include "boards/lv_setup.h"
#include "lv_i18n/lv_i18n.h" #include "lv_i18n/lv_i18n.h"
#include "ui/screens/launch_screen.h" #include "ui/screens/launch_screen.h"

View File

@@ -22,7 +22,7 @@
#include "lv_i18n/lv_i18n.h" #include "lv_i18n/lv_i18n.h"
#include "search_screen.h" #include "search_screen.h"
LV_IMG_DECLARE(os_railway_icon_lvgl); LV_IMG_DECLARE(os_railway_icon);
namespace LaunchScreen namespace LaunchScreen
{ {
@@ -46,7 +46,7 @@ namespace LaunchScreen
lv_obj_set_style_bg_color(screen, backgroundColor, 0); lv_obj_set_style_bg_color(screen, backgroundColor, 0);
auto *logo = lv_img_create(screen); auto *logo = lv_img_create(screen);
lv_img_set_src(logo, &os_railway_icon_lvgl); lv_img_set_src(logo, &os_railway_icon);
lv_obj_align(logo, LV_ALIGN_CENTER, 0, 0); lv_obj_align(logo, LV_ALIGN_CENTER, 0, 0);
auto *label = lv_label_create(screen); auto *label = lv_label_create(screen);

View File

@@ -85,9 +85,9 @@ namespace SearchScreen
lv_obj_clear_flag(search_screen, LV_OBJ_FLAG_SCROLLABLE); lv_obj_clear_flag(search_screen, LV_OBJ_FLAG_SCROLLABLE);
search_data_table = lv_table_create(search_screen); search_data_table = lv_table_create(search_screen);
lv_obj_set_size(search_data_table, SCREEN_WIDTH, SCREEN_HEIGHT); lv_obj_set_size(search_data_table, lv_pct(100), lv_pct(100));
lv_table_set_col_width(search_data_table, 0, SCREEN_WIDTH - 3); lv_table_set_col_width(search_data_table, 0, lv_pct(100) - 3);
lv_table_set_row_cnt(search_data_table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/ lv_table_set_row_cnt(search_data_table, ITEM_CNT); /*Not required but avoids a lot of memory reallocation lv_table_set_set_value*/
lv_table_set_col_cnt(search_data_table, 1); lv_table_set_col_cnt(search_data_table, 1);