From 0dc2a225b7716d05d0526336566e715c1d421fc5 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 30 Mar 2014 18:15:15 +0200 Subject: toggle led works sometimes --- main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.c b/main.c index 841cba2..f7c8756 100644 --- a/main.c +++ b/main.c @@ -14,6 +14,14 @@ USB_PUBLIC uchar usbFunctionSetup(uchar data[8]) { + usbRequest_t* rq = (usbRequest_t*) data; + + switch(rq->bRequest) + { + case 0: PORTB |= 1; break; + case 1: PORTB &= ~1; break; + } + return 0; } @@ -43,11 +51,14 @@ int main (void) usbDeviceDisconnect(); for (int i=0;i<100;i++) { + PORTB=~i; wdt_reset(); _delay_ms(5); } usbDeviceConnect(); + PORTB=~42; + sei(); while(1) -- cgit v1.2.3