pico hid: dip fix

This commit is contained in:
Maxim Devaev 2023-08-05 02:07:50 +03:00
parent 94025892f3
commit a8c3023aae
2 changed files with 3 additions and 1 deletions

View File

@ -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) {

View File

@ -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);