Skip to content

Commit 4b83474

Browse files
committed
Fix screen mirrored ili9341
on M5stack board the screen appear mirrored. and backlight invert
1 parent 09027fc commit 4b83474

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

components/gdisplay/gdisplay.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ driver_error_t *gdisplay_on() {
553553
gdisplay_ll_on();
554554

555555
#if CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT >= 0
556-
gpio_pin_clr(CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT);
556+
gpio_pin_set(CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT);
557557
#endif
558558

559559
return NULL;
@@ -568,7 +568,7 @@ driver_error_t *gdisplay_off() {
568568
gdisplay_ll_off();
569569

570570
#if CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT >= 0
571-
gpio_pin_set(CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT);
571+
gpio_pin_clr(CONFIG_LUA_RTOS_GDISPLAY_BACKLIGHT);
572572
#endif
573573

574574
return NULL;

components/gdisplay/gdisplay.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
#define LASTY -2
140140
#define CENTER -3
141141
#define RIGHT -4
142-
#define BOTTOM -4
142+
#define BOTTOM -5
143143

144144
// Fonts
145145
#define DEFAULT_FONT 0
@@ -166,11 +166,6 @@
166166

167167
#define swap(a, b) { int16_t t = a; a = b; b = t; }
168168

169-
#define LASTX -1
170-
#define LASTY -2
171-
#define CENTER -3
172-
#define RIGHT -4
173-
#define BOTTOM -4
174169

175170
typedef struct {
176171
uint8_t chipset; // Chipset

components/sys/drivers/ili9341.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static const uint8_t ILI9341_init[] = {
100100
0x28,
101101
ILI9341_VMCTR2, 1, //VCM control2
102102
0x86,
103-
ST7735_MADCTL, 1, // Memory Access Control
103+
ILI9341_RDMADCTL, 1, // Memory Access Control
104104
0x48,
105105
ILI9341_PIXFMT, 1,
106106
0x55,
@@ -347,7 +347,7 @@ void ili9341_set_orientation(uint8_t m) {
347347
break;
348348
}
349349

350-
gdisplay_ll_command(ST7735_MADCTL);
350+
gdisplay_ll_command(ILI9341_RDMADCTL);
351351
gdisplay_ll_data(&madctl, 1);
352352
}
353353

0 commit comments

Comments
 (0)