diff options
Diffstat (limited to 'keyboard')
| -rw-r--r-- | keyboard/keyboard.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/keyboard/keyboard.c b/keyboard/keyboard.c index dbba981..b70ac66 100644 --- a/keyboard/keyboard.c +++ b/keyboard/keyboard.c @@ -1,14 +1,35 @@ -#include <avr/eeprom.h> #include <avr/io.h> +#include <avr/interrupt.h> +#include <avr/wdt.h> + +#include "usbdrv.h" + #define F_CPU 16500000L // 16.5 MHZ #include <util/delay.h> +USB_PUBLIC uchar usbFunctionSetup(uchar data[8]) { + return 0; // do nothing for now +} + int main() { - DDRB |= _BV(DDB1); + uchar i; + wdt_enable(WDT0_1S); + + usbInit(); + + usbDeviceDisconnect(); + for (i=0; i<250; i++) { + wdt_reset(); + _delay_ms(2); + } + usbDeviceConnect(); + + sei(); + while (1) { - PORTB ^= _BV(PB1); - _delay_ms(100); - PORTB ^= _BV(PB1); - _delay_ms(900); + wdt_reset(); + usbPoll(); } + + return 0; } |
