Skip to content

Commit 4e07149

Browse files
committed
misc: code clean up
1 parent 1eb80e9 commit 4e07149

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

components/ugfx/src/gdriver/gdriver_mk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
#undef GDISP_DRIVER_LIST
1111

12-
#ifdef CONFIG_VFX_OUTPUT_ST7789
13-
#define GDISP_DRIVER_LIST GDISPVMT_ST7789
14-
#include "drivers/gdisp/ST7789/gdisp_lld_ST7789.c"
15-
#elif defined(CONFIG_VFX_OUTPUT_ST7735)
12+
#ifdef CONFIG_VFX_OUTPUT_ST7735
1613
#define GDISP_DRIVER_LIST GDISPVMT_ST7735
1714
#include "drivers/gdisp/ST7735/gdisp_lld_ST7735.c"
15+
#elif defined(CONFIG_VFX_OUTPUT_ST7789)
16+
#define GDISP_DRIVER_LIST GDISPVMT_ST7789
17+
#include "drivers/gdisp/ST7789/gdisp_lld_ST7789.c"
1818
#else
1919
#define GDISP_DRIVER_LIST GDISPVMT_CUBE0414
2020
#include "drivers/gdisp/CUBE0414/gdisp_lld_CUBE0414.c"

main/src/chip/spi.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ void hspi_init(void)
2626
.sclk_io_num = CONFIG_SPI_SCLK_PIN,
2727
.quadwp_io_num = -1,
2828
.quadhd_io_num = -1,
29-
#ifdef CONFIG_VFX_OUTPUT_CUBE0414
30-
.max_transfer_sz = CUBE0414_X*CUBE0414_Y*CUBE0414_Z*3
31-
#elif defined(CONFIG_VFX_OUTPUT_ST7735)
29+
#ifdef CONFIG_VFX_OUTPUT_ST7735
3230
.max_transfer_sz = ST7735_SCREEN_WIDTH*ST7735_SCREEN_HEIGHT*2
3331
#elif defined(CONFIG_VFX_OUTPUT_ST7789)
3432
.max_transfer_sz = ST7789_SCREEN_WIDTH*ST7789_SCREEN_HEIGHT*2
33+
#else
34+
.max_transfer_sz = CUBE0414_X*CUBE0414_Y*CUBE0414_Z*3
3535
#endif
3636
};
3737
ESP_ERROR_CHECK(spi_bus_initialize(HSPI_HOST, &buscfg, 1));
3838

3939
spi_device_interface_config_t devcfg = {
4040
.mode = 0, // SPI mode 0
4141
.spics_io_num = CONFIG_SPI_CS_PIN, // CS pin
42-
#ifdef CONFIG_VFX_OUTPUT_CUBE0414
43-
.clock_speed_hz = 40000000, // Clock out at 40 MHz
44-
.pre_cb = cube0414_setpin_dc, // Specify pre-transfer callback to handle D/C line
45-
#elif defined(CONFIG_VFX_OUTPUT_ST7735)
42+
#ifdef CONFIG_VFX_OUTPUT_ST7735
4643
.clock_speed_hz = 26000000, // Clock out at 26 MHz
4744
.pre_cb = st7735_setpin_dc, // Specify pre-transfer callback to handle D/C line
4845
#elif defined(CONFIG_VFX_OUTPUT_ST7789)
4946
.clock_speed_hz = 40000000, // Clock out at 40 MHz
5047
.pre_cb = st7789_setpin_dc, // Specify pre-transfer callback to handle D/C line
48+
#else
49+
.clock_speed_hz = 40000000, // Clock out at 40 MHz
50+
.pre_cb = cube0414_setpin_dc, // Specify pre-transfer callback to handle D/C line
5151
#endif
5252
.queue_size = 2, // We want to be able to queue 2 transactions at a time
5353
.flags = SPI_DEVICE_3WIRE | SPI_DEVICE_HALFDUPLEX

0 commit comments

Comments
 (0)