Revision 42
changed counter
kbc.c | ||
---|---|---|
22 | 22 |
uint8_t status = 0; |
23 | 23 |
got_error = 0; |
24 | 24 |
|
25 |
#ifdef LAB3 |
|
26 |
sys_inb_counter(INCREMENT); |
|
27 |
#endif |
|
28 |
|
|
29 | 25 |
if (util_sys_inb(STATUS_REG, &status)) { |
30 | 26 |
got_error = 1; |
31 | 27 |
return; |
... | ... | |
36 | 32 |
return; |
37 | 33 |
} |
38 | 34 |
|
39 |
#ifdef LAB3 |
|
40 |
sys_inb_counter(INCREMENT); |
|
41 |
#endif |
|
42 |
|
|
43 | 35 |
uint8_t byte = 0; |
44 | 36 |
|
45 | 37 |
if (util_sys_inb(OUTPUT_BUF, &byte)) { |
... | ... | |
57 | 49 |
|
58 | 50 |
} |
59 | 51 |
|
60 |
uint32_t (sys_inb_counter)(int increment) { |
|
61 |
static uint32_t counter = 0; |
|
62 |
if (increment) return ++counter; |
|
63 |
return counter; |
|
64 |
} |
|
65 |
|
|
66 | 52 |
int (kbd_poll)(uint8_t bytes[], uint8_t *size){ |
67 | 53 |
if(bytes == NULL || size == NULL) return 1; |
68 | 54 |
uint8_t c; |
Also available in: Unified diff