From c5b907cee19854bf59d34d0e2282d249abe0adc7 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 4 Apr 2014 22:16:09 +0200 Subject: reduced polling interval --- main.c | 13 +++++++++---- usbdrv/usbconfig.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index d7b7761..f2700fd 100644 --- a/main.c +++ b/main.c @@ -45,6 +45,7 @@ #include #include #include +#include #include "usbdrv/usbdrv.h" static char buffer[300]; // contains the exploded gamecube bits, i.e. each bit sent/received occupies one byte here. @@ -314,9 +315,12 @@ int main (void) debug(4); int temp=5; int n_received; - + + int toggle=0; while(1) { + toggle=~toggle; + debug(toggle); wdt_reset(); usbPoll(); @@ -358,14 +362,15 @@ debug(4); } - debug(temp % 64); - _delay_ms(0.3); - + //debug(temp % 64); +// _delay_ms(0.3); + _delay_us(10); char foo[] = { 0x40, 0x03, 0x02 }; if (!(PIND & 0x10)) foo[2]=0x03; + n_received=send_recv_gc(foo, 3); if (n_received == 64) { diff --git a/usbdrv/usbconfig.h b/usbdrv/usbconfig.h index 2296019..c409ce8 100644 --- a/usbdrv/usbconfig.h +++ b/usbdrv/usbconfig.h @@ -109,7 +109,7 @@ section at the end of this file). * (e.g. HID), but never want to send any data. This option saves a couple * of bytes in flash memory and the transmit buffers in RAM. */ -#define USB_CFG_INTR_POLL_INTERVAL 100 +#define USB_CFG_INTR_POLL_INTERVAL 10 /* If you compile a version with endpoint 1 (interrupt-in), this is the poll * interval. The value is in milliseconds and must not be less than 10 ms for * low speed devices. -- cgit v1.2.3