Revision 36
implemented keyboard polling
lab3.c | ||
---|---|---|
90 | 90 |
} |
91 | 91 |
|
92 | 92 |
int(kbd_test_poll)() { |
93 |
/* To be completed by the students */ |
|
94 |
printf("%s is not yet implemented!\n", __func__); |
|
95 |
|
|
96 |
return 1; |
|
93 |
uint8_t c[2]; uint8_t size; |
|
94 |
do{ |
|
95 |
if(kbd_poll(c, &size)) return 1; |
|
96 |
if(kbd_print_scancode((~c[0])&BREAK_CODE_BIT, size, c)) return 1; |
|
97 |
}while(!(size == 1 && c[0] == ESC_BREAK_CODE)); |
|
98 |
return 0; |
|
97 | 99 |
} |
98 | 100 |
|
99 | 101 |
int(kbd_test_timed_scan)(uint8_t n) { |
Also available in: Unified diff