summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2014-03-30 18:15:15 +0200
committerFlorian Jung <flo@windfisch.org>2014-03-30 18:15:48 +0200
commit0dc2a225b7716d05d0526336566e715c1d421fc5 (patch)
tree4b986fbfb0771c93a96d3847413101666b496600
parent0089ffa778c2ee955c90750752c18679d7018f4c (diff)
toggle led works sometimes
-rw-r--r--main.c11
1 files changed, 11 insertions, 0 deletions
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)