View difference between Paste ID: p5cYzxuU and GXQchmnQ
SHOW: | | - or go back to the newest paste.
1
unsigned char data = 0x00;
2
unsigned char bitcount;
3
4
ISR(INT0_vect)
5
{
6-
        /*
6+
7-
        if(bit_is_set(PIND, KBD_DATA_PIN))
7+
        if(bitcount)
8-
                send_character('1');
8+
9-
        else
9+
10-
                send_character('0');
10+
11-
        */
11+
                        data |= bitcount;
12-
        if(bitcount > 0 && bitcount < 9)
12+
13
        bitcount <<= 1;
14
        }else{
15
                char string[10];
16-
                        data |= (0x01 << (bitcount - 1));
16+
17
                send_string(string);
18
                data = 0x00;
19
                bitcount = 0x01; // lsb first, shift left
20-
        if(++bitcount == 11)
20+
21
}