Skip to content

Commit 2212baa

Browse files
committed
Fixed byteboy was initializing the LEDC driver for nothing
I don't have the schematics but it might have caused issues.
1 parent fa36fe1 commit 2212baa

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

components/retro-go/drivers/display/ili9341.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,7 @@ static void lcd_set_backlight(float percent)
155155
int error_code = 0;
156156

157157
#if defined(RG_GPIO_LCD_BCKL)
158-
#if defined(RG_TARGET_BYTEBOI_REV1)
159-
rg_i2c_gpio_set_direction(RG_GPIO_LCD_BCKL, RG_GPIO_OUTPUT);
160-
rg_i2c_gpio_set_level(RG_GPIO_LCD_BCKL, percent > 0 ? 0:1);
161-
#else
162158
error_code = ledc_set_fade_time_and_start(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, 0x1FFF * level, 50, 0);
163-
#endif
164159
#elif defined(RG_TARGET_QTPY_GAMER)
165160
rg_i2c_gpio_set_direction(AW_TFT_BACKLIGHT, RG_GPIO_ANALOG_OUTPUT);
166161
rg_i2c_gpio_set_level(AW_TFT_BACKLIGHT, level * 255);

components/retro-go/targets/byteboi-rev1/config.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// #define RG_STORAGE_SDMMC_SPEED SDMMC_FREQ_DEFAULT
1010
// #define RG_STORAGE_FLASH_PARTITION "vfs"
1111

12+
// GPIO Extender
13+
#define RG_I2C_GPIO_DRIVER 2 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017
14+
#define RG_I2C_GPIO_ADDR 0x74
15+
1216
// Audio
1317
#define RG_AUDIO_USE_INT_DAC 1 // 0 = Disable, 1 = GPIO25, 2 = GPIO26, 3 = Both
1418
#define RG_AUDIO_USE_EXT_DAC 0 // 0 = Disable, 1 = Enable
@@ -39,11 +43,12 @@
3943
ILI9341_CMD(0xB1, 0x00, 0x10); /* Frame Rate Control (1B=70, 1F=61, 10=119) */ \
4044
ILI9341_CMD(0xB6, 0x08, 0xC2, 0x27); /* Display Function Control */ \
4145
ILI9341_CMD(0xF6, 0x01, 0x30); \
42-
ILI9341_CMD(0xF2, 0x00); /* 3Gamma Function Disable */ \
43-
ILI9341_CMD(0x26, 0x01); /* Gamma curve selected */ \
46+
ILI9341_CMD(0xF2, 0x00); /* 3Gamma Function Disable */ \
47+
ILI9341_CMD(0x26, 0x01); /* Gamma curve selected */ \
4448
ILI9341_CMD(0xE0, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00); \
45-
ILI9341_CMD(0xE1, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F);
46-
49+
ILI9341_CMD(0xE1, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F); \
50+
rg_i2c_gpio_set_direction(12, RG_GPIO_OUTPUT); /* Backlight */ \
51+
rg_i2c_gpio_set_level(12, 0);
4752

4853
// Input
4954
// Refer to rg_input.h to see all available RG_KEY_* and RG_GAMEPAD_*_MAP types
@@ -69,10 +74,6 @@
6974
#define RG_BATTERY_CALC_PERCENT(raw) (((raw) * 2.f - 3500.f) / (4200.f - 3500.f) * 100.f)
7075
#define RG_BATTERY_CALC_VOLTAGE(raw) ((raw) * 2.f * 0.001f)
7176

72-
// GPIO Extender
73-
#define RG_I2C_GPIO_DRIVER 2 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017
74-
#define RG_I2C_GPIO_ADDR 0x74
75-
7677

7778
// Status LED
7879
//#define RG_GPIO_LED GPIO_NUM_14
@@ -87,7 +88,7 @@
8788
#define RG_GPIO_LCD_CLK GPIO_NUM_26
8889
#define RG_GPIO_LCD_CS GPIO_NUM_33
8990
#define RG_GPIO_LCD_DC GPIO_NUM_21
90-
#define RG_GPIO_LCD_BCKL GPIO_NUM_12
91+
// #define RG_GPIO_LCD_BCKL GPIO_NUM_12
9192
#define RG_GPIO_LCD_RST GPIO_NUM_27
9293

9394
// SPI SD Card

components/retro-go/targets/qtpy-gamer/config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// #define RG_STORAGE_SDMMC_SPEED SDMMC_FREQ_DEFAULT
1010
// #define RG_STORAGE_FLASH_PARTITION "vfs"
1111

12+
// GPIO Extender
13+
#define RG_I2C_GPIO_DRIVER 1 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017
14+
#define RG_I2C_GPIO_ADDR 0x58
15+
1216
// Audio
1317
#define RG_AUDIO_USE_INT_DAC 2 // 0 = Disable, 1 = GPIO25, 2 = GPIO26, 3 = Both
1418
#define RG_AUDIO_USE_EXT_DAC 0 // 0 = Disable, 1 = Enable
@@ -48,10 +52,6 @@
4852
#define RG_BATTERY_CALC_PERCENT(raw) (99)
4953
#define RG_BATTERY_CALC_VOLTAGE(raw) (0)
5054

51-
// GPIO Extender
52-
#define RG_I2C_GPIO_DRIVER 1 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017
53-
#define RG_I2C_GPIO_ADDR 0x58
54-
5555

5656
// Status LED - not actually used, we've got neopixels instead :/
5757
// #define RG_GPIO_LED GPIO_NUM_NC

0 commit comments

Comments
 (0)