Project

General

Profile

Revision 78

fixed ack reading issue. added statemachine, still not working

View differences:

kbc.c
67 67
    int ret = 0;
68 68
    uint8_t stat;
69 69
    for(int i = 0; i < KBC_NUM_TRIES; ++i){
70
        if((ret = util_sys_inb(STATUS_REG, &stat))) return ret;//printf("kbc.c,L71\n");
71
        printf("%x %d %d\n", stat, (stat&OUT_BUF_FUL), (stat&AUX_MOUSE));
72
        if((stat&OUT_BUF_FUL) && (stat&AUX_MOUSE)==0){//printf("kbc.c,L72\n");
73
            if(stat & (PARITY_ERROR | TIME_OUT_REC)) return OTHER_ERROR;//printf("kbc.c,L73\n");
70
        if((ret = util_sys_inb(STATUS_REG, &stat))) return ret;
71
        if((stat&OUT_BUF_FUL) && (stat&AUX_MOUSE)==0){
72
            if(stat & (PARITY_ERROR | TIME_OUT_REC)) return OTHER_ERROR;
74 73
            if((ret = util_sys_inb(OUTPUT_BUF, byte))) return ret;
75 74
            else return SUCCESS;
76 75
        }

Also available in: Unified diff