Revision 56
implementing mouse_parse_packet
lab4.c | ||
---|---|---|
29 | 29 |
return 0; |
30 | 30 |
} |
31 | 31 |
|
32 |
extern uint8_t packet[3]; |
|
33 |
extern int counter; |
|
32 | 34 |
|
33 | 35 |
int (mouse_test_packet)(uint32_t cnt) { |
34 | 36 |
/// loop stuff |
... | ... | |
42 | 44 |
if(mouse_enable_data_reporting()) return 1; |
43 | 45 |
/// cycle |
44 | 46 |
int good = 1; |
47 |
uint32_t cnt_now = 0; |
|
45 | 48 |
while (good) { |
46 | 49 |
/* Get a request message. */ |
47 | 50 |
if ((r = driver_receive(ANY, &msg, &ipc_status)) != 0) { |
... | ... | |
53 | 56 |
case HARDWARE: /* hardware interrupt notification */ |
54 | 57 |
if (msg.m_notify.interrupts & mouse_irq) { /* subscribed interrupt */ |
55 | 58 |
mouse_ih(); |
59 |
if(counter >= 3){ |
|
60 |
struct packet pp = mouse_parse_packet(packet); |
|
61 |
mouse_print_packet(&pp); |
|
62 |
cnt_now++; |
|
63 |
if(cnt == cnt_now) good = 0; |
|
64 |
} |
|
56 | 65 |
/* |
57 | 66 |
if (!(two_byte_scancode || got_error)) { // finished processing a scancode |
58 | 67 |
if (scancode[0] == TWO_BYTE_CODE) kbd_print_scancode(!(scancode[1] & BREAK_CODE_BIT), 2, scancode); |
Also available in: Unified diff