source:
avrstuff/ps2toserial/code/main.c@
d3f2c17
Last change on this file since d3f2c17 was d3f2c17, checked in by , 14 years ago | |
---|---|
|
|
File size: 495 bytes |
Rev | Line | |
---|---|---|
[b82c7b3] | 1 | #include <avr/io.h> |
2 | ||
[d3f2c17] | 3 | #include "../../libs/ps2_keyboard/ps2_keyboard.h" |
4 | #include "../../libs/usart/usart.h" | |
[b82c7b3] | 5 | |
6 | int main() { | |
7 | ||
[d3f2c17] | 8 | USARTInit(8); |
[b82c7b3] | 9 | init_keyboard(); |
[d3f2c17] | 10 | |
11 | USARTWriteChar('r'); | |
[b82c7b3] | 12 | |
13 | //debug LED - output | |
14 | DDRD |= (1<<PD6); | |
15 | ||
16 | uint8_t key_code = 0; | |
17 | ||
18 | char str_buf[21]; | |
19 | uint8_t buf_pos = 0; | |
20 | ||
21 | str_buf[0] = str_buf[1] = 0x00; | |
22 | USARTWriteChar('R'); | |
23 | ||
24 | while(1) { | |
25 | key_code = read_char(); | |
26 | USARTWriteChar(render_scan_code(key_code)); | |
27 | } | |
28 | ||
29 | return 0; | |
30 | } | |
31 |
Note:
See TracBrowser
for help on using the repository browser.