Project

General

Profile

Revision 87

fixed stuff

View differences:

mouse.c
91 91
    for (unsigned int i = 0; i < KBC_NUM_TRIES; i++) {
92 92
        if ((ret = kbc_issue_cmd(MOUSE_WRITE_B))) return ret;
93 93
        if ((ret = kbc_issue_arg(cmd))) return ret;
94
        if ((ret = mouse_read_ack(&ack))) return ret;
94
        if ((ret = mouse_read_byte(&ack))) return ret;
95 95

  
96 96
        if (ack == ACK_OK) return SUCCESS;
97 97
        if (ack == ACK_ERROR) return INVALID_COMMAND;
......
115 115
    return TIMEOUT_ERROR;
116 116
}
117 117

  
118
int (mouse_read_ack)(uint8_t *byte) {
119
    int ret = 0;
120
    uint8_t stat;
121
    //for(int i = 0; i < KBC_NUM_TRIES; ++i){
122
        if((ret = util_sys_inb(STATUS_REG, &stat))) return ret;
123
        //if((stat&OUT_BUF_FUL) && (stat&AUX_MOUSE)) {
124
            if(stat & (PARITY_ERROR | TIME_OUT_REC)) return OTHER_ERROR;
125
            if((ret = util_sys_inb(OUTPUT_BUF, byte))) return ret;
126
            else return SUCCESS;
127
        //}
128
        //tickdelay(micros_to_ticks(DELAY));
129
    //}
130
    //return TIMEOUT_ERROR;
131
}
132

  
133 118
int (mouse_poll_byte)(uint8_t *byte, uint16_t period) {
134 119
    int ret = 0;
135 120
    uint8_t stat;

Also available in: Unified diff