Revision 73
small change
lab4/lab4.c | ||
---|---|---|
44 | 44 |
int mouse_id = 0; |
45 | 45 |
int mouse_irq = BIT(mouse_irq_bit); |
46 | 46 |
if (subscribe_mouse_interrupt(mouse_irq_bit, &mouse_id)) return 1; |
47 |
if (mouse_issue_cmd(ENABLE_DATA_REP)) return 1;
|
|
47 |
if (mouse_set_data_report(true)) return 1;
|
|
48 | 48 |
/// cycle |
49 | 49 |
int good = 1; |
50 | 50 |
uint32_t cnt_now = 0; |
... | ... | |
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
if (unsubscribe_interrupt(&mouse_id)) return 1; |
79 |
if (mouse_issue_cmd(DIS_DATA_REP)) return 1;
|
|
79 |
if (mouse_set_data_report(false)) return 1;
|
|
80 | 80 |
|
81 | 81 |
return 0; |
82 | 82 |
} |
... | ... | |
116 | 116 |
// Set Stream mode |
117 | 117 |
if ((ret = mouse_issue_cmd(SET_STREAM_MD))) return ret; |
118 | 118 |
// Disable data reporting |
119 |
if ((ret = mouse_issue_cmd(DIS_DATA_REP))) return ret;
|
|
119 |
if ((ret = mouse_set_data_report(false))) return ret;
|
|
120 | 120 |
|
121 | 121 |
uint8_t cmd_byte = minix_get_dflt_kbc_cmd_byte(); |
122 | 122 |
if ((ret = kbc_change_cmd(cmd_byte))) return ret; |
lab4/mouse.c | ||
---|---|---|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
int (mouse_set_data_report)(int on){ |
60 |
int ret = 0; |
|
61 |
if((ret = kbc_issue_cmd(MOUSE_WRITE_B))) return ret; |
|
62 |
if((ret = kbc_issue_arg(DIS_DATA_REP))) return ret; |
|
63 |
uint8_t ack = 0; |
|
64 |
printf("L64\n"); |
|
65 |
if((ret = kbc_read_byte(&ack))) return ret; |
|
66 |
printf("L66\n"); |
|
67 |
printf("ACK: %x\n", ack); |
|
68 |
return SUCCESS; |
|
60 |
if(on) return mouse_issue_cmd(ENABLE_DATA_REP); |
|
61 |
else return mouse_issue_cmd( DIS_DATA_REP); |
|
69 | 62 |
} |
70 | 63 |
|
71 | 64 |
int (mouse_read_data)(uint8_t *data) { |
Also available in: Unified diff