summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2014-04-04 22:16:09 +0200
committerFlorian Jung <flo@windfisch.org>2014-04-04 22:16:09 +0200
commitc5b907cee19854bf59d34d0e2282d249abe0adc7 (patch)
tree7bd8140973e9945e41ee75ef2ed54ecc161da3f0
parente399da62dc6e0bdc216efc2590e5e9b649afaa9d (diff)
reduced polling interval
-rw-r--r--main.c13
-rw-r--r--usbdrv/usbconfig.h2
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 <avr/delay.h>
#include <avr/wdt.h>
#include <avr/interrupt.h>
+#include <avr/sleep.h>
#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.