Skip to content

Commit fa36fe1

Browse files
committed
rg_input: Fixed inverted i2c gpio input value
Since it's now possible to specify the expected bit value in the target's config.h, it makes no sense to invert the value anymore.
1 parent 936ea8c commit fa36fe1

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

components/retro-go/rg_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ bool rg_input_read_gamepad_raw(uint32_t *out)
129129
#if defined(RG_GAMEPAD_I2C_MAP)
130130
uint32_t buttons = 0;
131131
#if defined(RG_I2C_GPIO_DRIVER)
132-
buttons = ~(rg_i2c_gpio_read_port(0) | rg_i2c_gpio_read_port(1) << 8);
132+
buttons = (rg_i2c_gpio_read_port(0) | rg_i2c_gpio_read_port(1) << 8);
133133
#elif defined(RG_TARGET_T_DECK_PLUS)
134134
uint8_t data[5];
135135
if (rg_i2c_read(T_DECK_KBD_ADDRESS, -1, &data, 5)) {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
// Input
4949
// Refer to rg_input.h to see all available RG_KEY_* and RG_GAMEPAD_*_MAP types
5050
#define RG_GAMEPAD_I2C_MAP {\
51-
{RG_KEY_UP, 0, 1},\
52-
{RG_KEY_RIGHT, 2, 1},\
53-
{RG_KEY_DOWN, 3, 1},\
54-
{RG_KEY_LEFT, 1, 1},\
55-
{RG_KEY_SELECT, 4, 1},\
56-
{RG_KEY_A, 6, 1},\
57-
{RG_KEY_B, 5, 1},\
51+
{RG_KEY_UP, 0, 0},\
52+
{RG_KEY_RIGHT, 2, 0},\
53+
{RG_KEY_DOWN, 3, 0},\
54+
{RG_KEY_LEFT, 1, 0},\
55+
{RG_KEY_SELECT, 4, 0},\
56+
{RG_KEY_A, 6, 0},\
57+
{RG_KEY_B, 5, 0},\
5858
}
5959
#define RG_GAMEPAD_VIRT_MAP {\
6060
{RG_KEY_START, RG_KEY_A | RG_KEY_SELECT},\

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
// Input
3232
// Refer to rg_input.h to see all available RG_KEY_* and RG_GAMEPAD_*_MAP types
3333
#define RG_GAMEPAD_I2C_MAP {\
34-
{RG_KEY_UP, 10, 1},\
35-
{RG_KEY_RIGHT, 12, 1},\
36-
{RG_KEY_DOWN, 13, 1},\
37-
{RG_KEY_LEFT, 14, 1},\
38-
{RG_KEY_SELECT, 2, 1},\
39-
{RG_KEY_START, 4, 1},\
40-
{RG_KEY_MENU, 11, 1},\
41-
{RG_KEY_OPTION, 5, 1},\
42-
{RG_KEY_A, 6, 1},\
43-
{RG_KEY_B, 7, 1},\
34+
{RG_KEY_UP, 10, 0},\
35+
{RG_KEY_RIGHT, 12, 0},\
36+
{RG_KEY_DOWN, 13, 0},\
37+
{RG_KEY_LEFT, 14, 0},\
38+
{RG_KEY_SELECT, 2, 0},\
39+
{RG_KEY_START, 4, 0},\
40+
{RG_KEY_MENU, 11, 0},\
41+
{RG_KEY_OPTION, 5, 0},\
42+
{RG_KEY_A, 6, 0},\
43+
{RG_KEY_B, 7, 0},\
4444
}
4545

4646
// Battery

0 commit comments

Comments
 (0)