aboutsummaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'protocol')
-rw-r--r--protocol/adb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/protocol/adb.c b/protocol/adb.c
index d60b8608b..d7105b3a9 100644
--- a/protocol/adb.c
+++ b/protocol/adb.c
@@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
38#include <stdbool.h> 38#include <stdbool.h>
39#include <util/delay.h> 39#include <util/delay.h>
40#include <avr/io.h> 40#include <avr/io.h>
41#include <avr/interrupt.h>
41#include "adb.h" 42#include "adb.h"
42 43
43 44
@@ -85,8 +86,13 @@ uint16_t adb_host_kbd_recv(void)
85 return 0; // No data to send 86 return 0; // No data to send
86 if (!read_bit()) // Startbit(1) 87 if (!read_bit()) // Startbit(1)
87 return -2; 88 return -2;
89
90 // ad hoc fix: without block inerrupt read wrong bit occasionally and get keys stuck
91 cli();
88 data = read_byte(); 92 data = read_byte();
89 data = (data<<8) | read_byte(); 93 data = (data<<8) | read_byte();
94 sei();
95
90 if (read_bit()) // Stopbit(0) 96 if (read_bit()) // Stopbit(0)
91 return -3; 97 return -3;
92 return data; 98 return data;