diff options
author | Maxim Devaev <[email protected]> | 2023-08-25 12:35:28 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-08-25 12:35:28 +0300 |
commit | 21eddbde1c11961d7fb958422d6dd72b94c33375 (patch) | |
tree | 2a869d17932914a4481e6356dc78ab8690cd872c /hid/pico/src/ph_outputs.c | |
parent | 82ca2b1caed602030d2d849a9e61748ea7249ac9 (diff) |
pico hid bridge mode
Diffstat (limited to 'hid/pico/src/ph_outputs.c')
-rw-r--r-- | hid/pico/src/ph_outputs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hid/pico/src/ph_outputs.c b/hid/pico/src/ph_outputs.c index 307b25db..a61b659f 100644 --- a/hid/pico/src/ph_outputs.c +++ b/hid/pico/src/ph_outputs.c @@ -35,6 +35,8 @@ #define _PS2_SET_KBD_PIN 3 #define _PS2_SET_MOUSE_PIN 4 +#define _BRIDGE_MODE_PIN 5 + #define _USB_DISABLED_PIN 6 #define _USB_ENABLE_W98_PIN 7 #define _USB_SET_MOUSE_REL_PIN 8 @@ -43,6 +45,7 @@ u8 ph_g_outputs_active = 0; u8 ph_g_outputs_avail = 0; +bool ph_g_is_bridge = false; static int _read_outputs(void); @@ -54,6 +57,8 @@ void ph_outputs_init(void) { INIT_SWITCH(_PS2_SET_KBD_PIN); INIT_SWITCH(_PS2_SET_MOUSE_PIN); + INIT_SWITCH(_BRIDGE_MODE_PIN); + INIT_SWITCH(_USB_DISABLED_PIN); INIT_SWITCH(_USB_ENABLE_W98_PIN); INIT_SWITCH(_USB_SET_MOUSE_REL_PIN); @@ -65,7 +70,9 @@ void ph_outputs_init(void) { const bool o_ps2_kbd = !gpio_get(_PS2_SET_KBD_PIN); const bool o_ps2_mouse = !gpio_get(_PS2_SET_MOUSE_PIN); - const bool o_usb_disabled = !gpio_get(_USB_DISABLED_PIN); + ph_g_is_bridge = !gpio_get(_BRIDGE_MODE_PIN); + + const bool o_usb_disabled = (ph_g_is_bridge || !gpio_get(_USB_DISABLED_PIN)); const bool o_usb_enabled_w98 = !gpio_get(_USB_ENABLE_W98_PIN); const bool o_usb_mouse_rel = !gpio_get(_USB_SET_MOUSE_REL_PIN); const bool o_usb_mouse_w98 = !gpio_get(_USB_SET_MOUSE_W98_PIN); |