Changeset 87ab18e in avrstuff for kbd/xtk/code/main.c
- Timestamp:
- Jul 31, 2014, 11:00:37 PM (10 years ago)
- Branches:
- main
- Children:
- 0010058
- Parents:
- ea32107
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kbd/xtk/code/main.c
rea32107 r87ab18e 24 24 void callback() 25 25 { 26 uint8_t key_code = 0;27 key_code = read_char(); // TODO this function is blocking. Can it disturb main?28 29 key = pgm_read_byte(&(at2xt[key_code]));30 if(release)31 key |= 0x80;26 // Ignore all keys above 0x80, and importantly ignore 0xE0 from extended keys. 27 if (kbd_data < 0x80) { 28 key = pgm_read_byte(&(at2xt[kbd_data])); 29 if(release) 30 key |= 0x80; 31 } 32 32 } 33 33 … … 52 52 #endif 53 53 54 static const int delay = 25;54 static const int delay = 12; 55 55 56 56 // XT init - configure pins directions … … 58 58 DDRXT &= ~(PCLK | PDAT); // both pins as inputs (floating) 59 59 60 DDRB |= (1<<PB2); // LED61 62 60 uint8_t k; 63 61 while(1) { 64 PORTB ^= (1<<PB2); // LED65 66 62 while ((PINXT & (PDAT|PCLK)) != (PDAT|PCLK)) 67 63 ; // Wait for PC to be ready to receive data
Note:
See TracChangeset
for help on using the changeset viewer.