Project

General

Profile

Revision 48

Fixes

View differences:

kbc_func.c
15 15
}
16 16

  
17 17
uint8_t scancode[2];
18
int two_byte_scancode = 0;
19 18
int got_error = 0;
19
int done = 0;
20
int sz = 1;
20 21

  
21 22
void (kbc_ih)(void) {
22 23
    uint8_t status = 0;
......
39 40
        return;
40 41
    }
41 42

  
42
    if (two_byte_scancode) {
43
    if (sz == 2 && done == 0) {
43 44
        scancode[1] = byte;
44
        two_byte_scancode = 0;
45
        done = 1;
45 46
    } else {
46 47
        scancode[0] = byte;
47
        two_byte_scancode = (byte == TWO_BYTE_CODE);
48
        if (byte == TWO_BYTE_CODE) {
49
            sz = 2;
50
            done = 0;
51
        } else {
52
            sz = 1;
53
            done = 1;
54
        }
48 55
    }
49 56

  
50 57
}

Also available in: Unified diff