diff options
author | Maxim Devaev <[email protected]> | 2023-08-05 02:07:50 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-08-05 02:07:50 +0300 |
commit | a8c3023aaeb3e5146fad79cb387c9379eac7487f (patch) | |
tree | e681e265060972bbfd24e2b8adca9a226b9dd7cc /hid | |
parent | 94025892f3ed51a594e568a2f0d5731031cc6a46 (diff) |
pico hid: dip fix
Diffstat (limited to 'hid')
-rw-r--r-- | hid/pico/src/main.c | 3 | ||||
-rw-r--r-- | hid/pico/src/ph_outputs.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/hid/pico/src/main.c b/hid/pico/src/main.c index 2819bd7a..7d8c6843 100644 --- a/hid/pico/src/main.c +++ b/hid/pico/src/main.c @@ -127,7 +127,8 @@ int main(void) { gpio_init(_COMM_PIN); gpio_set_dir(_COMM_PIN, GPIO_IN); gpio_pull_up(_COMM_PIN); - _comm_use_spi = !gpio_get(_COMM_PIN); + sleep_ms(10); // Нужен небольшой слип для активации pull-up + _comm_use_spi = gpio_get(_COMM_PIN); _COMM(init, _data_handler, _timeout_handler); while (true) { diff --git a/hid/pico/src/ph_outputs.c b/hid/pico/src/ph_outputs.c index a1963f7d..4722a81c 100644 --- a/hid/pico/src/ph_outputs.c +++ b/hid/pico/src/ph_outputs.c @@ -58,6 +58,7 @@ void ph_outputs_init(void) { INIT_SWITCH(_USB_SET_MOUSE_REL_PIN); INIT_SWITCH(_USB_SET_MOUSE_W98_PIN); # undef INIT_SWITCH + sleep_ms(10); // Нужен небольшой слип для активации pull-up const bool o_ps2_enabled = !gpio_get(_PS2_ENABLED_PIN); // Note: all pins are pulled up! const bool o_ps2_kbd = !gpio_get(_PS2_SET_KBD_PIN); |