X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fps2.c;h=4c6c2fcb27b379b3e37b0f8e8adc5e66e237c5af;hb=1591764cfbc39e73c6f32e9b805d596379866ff0;hp=cf7b1f43ce42076e9b6eb876b844180afb427cc3;hpb=1ac674db66e47e69b87c4c78566932ab73225836;p=max%2Ftmk_keyboard.git diff --git a/protocol/ps2.c b/protocol/ps2.c index cf7b1f43..4c6c2fcb 100644 --- a/protocol/ps2.c +++ b/protocol/ps2.c @@ -109,12 +109,12 @@ uint8_t ps2_host_send(uint8_t data) #endif /* terminate a transmission if we have */ inhibit(); - _delay_us(100); + _delay_us(200); // at least 100us /* start bit [1] */ data_lo(); clock_hi(); - WAIT(clock_lo, 15000, 1); + WAIT(clock_lo, 20000, 10); // may take 15ms at most until device starts clocking /* data [2-9] */ for (uint8_t i = 0; i < 8; i++) { _delay_us(15); @@ -167,7 +167,7 @@ uint8_t ps2_host_recv_response(void) idle(); /* wait start bit */ - wait_clock_lo(2000); + wait_clock_lo(25000); // command response may take 20 ms at most data = recv_data(); inhibit(); @@ -181,7 +181,7 @@ uint8_t ps2_host_recv(void) } #else /* ring buffer to store ps/2 key data */ -#define PBUF_SIZE 8 +#define PBUF_SIZE 32 static uint8_t pbuf[PBUF_SIZE]; static uint8_t pbuf_head = 0; static uint8_t pbuf_tail = 0;