Skip to content

Commit 74502da

Browse files
committed
main: code refactoring
1 parent df2151d commit 74502da

37 files changed

+245
-137
lines changed

components/ugfx/src/gdriver/gdriver_mk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#undef GDISP_DRIVER_LIST
1111

12-
#ifdef CONFIG_SCREEN_PANEL_ST7735
12+
#ifdef CONFIG_LCD_TYPE_ST7735
1313
#define GDISP_DRIVER_LIST GDISPVMT_ST7735
1414
#include "drivers/gdisp/ST7735/gdisp_lld_ST7735.c"
1515
#else

main/Kconfig.projbuild

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,31 +113,49 @@ config ENABLE_GUI
113113
help
114114
Select this to enable gui.
115115

116-
choice SCREEN_PANEL
117-
prompt "Screen Panel"
118-
default SCREEN_PANEL_ST7789
116+
choice LCD_TYPE
117+
prompt "LCD Type"
118+
default LCD_TYPE_ST7789
119119
depends on ENABLE_GUI
120120
help
121-
Select which screen panel to use.
121+
Select which LCD type to use.
122122

123-
config SCREEN_PANEL_ST7735
123+
config LCD_TYPE_ST7735
124124
bool "ST7735 80x160 LCD Panel"
125-
config SCREEN_PANEL_ST7789
125+
config LCD_TYPE_ST7789
126126
bool "ST7789 135x240 LCD Panel"
127127
endchoice
128128

129-
config DEV_RST_PIN
130-
int "Device RST Pin"
129+
choice LCD_ORIENTATION
130+
prompt "LCD Orientation"
131+
default LCD_ORIENTATION_NORMAL
132+
depends on ENABLE_GUI
133+
help
134+
Select LCD orientation.
135+
136+
config LCD_ORIENTATION_NORMAL
137+
bool "Normal"
138+
config LCD_ORIENTATION_UPSIDE_DOWN
139+
bool "Upside Down"
140+
endchoice
141+
142+
config LCD_ROTATION_DEGREE
143+
int
144+
default 90 if LCD_ORIENTATION_NORMAL
145+
default 270 if LCD_ORIENTATION_UPSIDE_DOWN
146+
147+
config LCD_RST_PIN
148+
int "LCD RST Pin"
131149
default 14
132150
depends on ENABLE_GUI
133151

134-
config DEV_DC_PIN
135-
int "Device DC Pin"
152+
config LCD_DC_PIN
153+
int "LCD DC Pin"
136154
default 23
137155
depends on ENABLE_GUI
138156

139-
config DEV_BL_PIN
140-
int "Device BL Pin"
157+
config LCD_BL_PIN
158+
int "LCD BL Pin"
141159
default 4
142160
depends on ENABLE_GUI
143161

main/inc/user/audio_player.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
typedef enum {
1212
MP3_FILE_IDX_NOTIFY = 0x00,
13-
MP3_FILE_IDX_AUTH_DONE = 0x01,
14-
MP3_FILE_IDX_AUTH_FAIL = 0x02,
15-
MP3_FILE_IDX_CONN_TOUT = 0x03,
16-
MP3_FILE_IDX_CONN_FAIL = 0x04,
17-
MP3_FILE_IDX_WIFI_DOWN = 0x05,
18-
MP3_FILE_IDX_WIFI_CFG = 0x06,
19-
MP3_FILE_IDX_SRVC_ERR = 0x07,
13+
MP3_FILE_IDX_ERROR_REQ = 0x01,
14+
MP3_FILE_IDX_ERROR_RSP = 0x02,
15+
MP3_FILE_IDX_AUTH_DONE = 0x03,
16+
MP3_FILE_IDX_AUTH_FAIL = 0x04,
17+
MP3_FILE_IDX_CONN_TOUT = 0x05,
18+
MP3_FILE_IDX_CONN_FAIL = 0x06,
19+
MP3_FILE_IDX_WIFI_CFG = 0x07,
2020

2121
MP3_FILE_IDX_MAX
2222
} mp3_file_t;

main/inc/user/gui.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
typedef enum {
1212
GUI_MODE_IDX_GIF_WIFI = 0x00,
13-
GUI_MODE_IDX_GIF_BUSY = 0x01,
14-
GUI_MODE_IDX_GIF_DONE = 0x02,
15-
GUI_MODE_IDX_GIF_SCAN = 0x03,
16-
GUI_MODE_IDX_GIF_PWR = 0x04,
17-
GUI_MODE_IDX_GIF_CLK = 0x05,
18-
GUI_MODE_IDX_GIF_ERR = 0x06,
13+
GUI_MODE_IDX_GIF_SCAN = 0x01,
14+
GUI_MODE_IDX_GIF_BUSY = 0x02,
15+
GUI_MODE_IDX_GIF_DONE = 0x03,
16+
GUI_MODE_IDX_GIF_FAIL = 0x04,
17+
GUI_MODE_IDX_GIF_PWR = 0x05,
18+
GUI_MODE_IDX_GIF_CLK = 0x06,
1919
GUI_MODE_IDX_GIF_CFG = 0x07,
2020
GUI_MODE_IDX_GIF_UPD = 0x08,
2121

@@ -25,7 +25,7 @@ typedef enum {
2525
GUI_MODE_IDX_OFF = 0xFF
2626
} gui_mode_t;
2727

28-
#ifdef CONFIG_SCREEN_PANEL_ST7735
28+
#ifdef CONFIG_LCD_TYPE_ST7735
2929
// ani0.gif
3030
extern const char ani0_160x80_gif_ptr[] asm("_binary_ani0_160x80_gif_start");
3131
extern const char ani0_160x80_gif_end[] asm("_binary_ani0_160x80_gif_end");

main/res/ani/ani1_160x80.gif

-3.26 KB
Loading

main/res/ani/ani1_240x135.gif

-2.55 KB
Loading

main/res/ani/ani2_160x80.gif

-2.04 KB
Loading

main/res/ani/ani2_240x135.gif

-931 Bytes
Loading

main/res/ani/ani3_160x80.gif

5.3 KB
Loading

main/res/ani/ani3_240x135.gif

3.46 KB
Loading

0 commit comments

Comments
 (0)