aboutsummaryrefslogtreecommitdiffstats
path: root/examples/custom-class
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2008-05-04 20:07:30 +0000
committerChristian Starkjohann <cs+github@obdev.at>2008-05-04 20:07:30 +0000
commit3db37d1c9e5cfde7f7364927c8f03e83369fc033 (patch)
tree926a8f704035524e7fcd8771a589a725ab9d7163 /examples/custom-class
parentb730907357a33a47e4691977a0229172e6c2d3b3 (diff)
downloadv-usb-3db37d1c9e5cfde7f7364927c8f03e83369fc033.tar.gz
v-usb-3db37d1c9e5cfde7f7364927c8f03e83369fc033.tar.bz2
v-usb-3db37d1c9e5cfde7f7364927c8f03e83369fc033.zip
- converted tabs to spaces
- use usbMsgLen_t in usbFunctionSetup()
Diffstat (limited to 'examples/custom-class')
-rw-r--r--examples/custom-class/firmware/main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/custom-class/firmware/main.c b/examples/custom-class/firmware/main.c
index 2d93db9..940f62e 100644
--- a/examples/custom-class/firmware/main.c
+++ b/examples/custom-class/firmware/main.c
@@ -34,7 +34,7 @@ different port or bit, change the macros below:
/* ----------------------------- USB interface ----------------------------- */
/* ------------------------------------------------------------------------- */
-uchar usbFunctionSetup(uchar data[8])
+usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
@@ -50,16 +50,16 @@ usbRequest_t *rq = (void *)data;
usbMsgPtr = dataBuffer; /* tell the driver which data to return */
return 1; /* tell the driver to send 1 byte */
}
- return 0; /* default for not implemented requests: return no data back to host */
+ return 0; /* default for not implemented requests: return no data back to host */
}
/* ------------------------------------------------------------------------- */
-int main(void)
+int main(void)
{
uchar i;
- wdt_enable(WDTO_1S);
+ wdt_enable(WDTO_1S);
/* Even if you don't use the watchdog, turn it off here. On newer devices,
* the status of the watchdog (on/off, period) is PRESERVED OVER RESET!
*/
@@ -68,8 +68,8 @@ uchar i;
* That's the way we need D+ and D-. Therefore we don't need any
* additional hardware initialization.
*/
- odDebugInit();
- usbInit();
+ odDebugInit();
+ usbInit();
usbDeviceDisconnect(); /* enforce re-enumeration, do this while interrupts are disabled! */
i = 0;
while(--i){ /* fake USB disconnect for > 250 ms */
@@ -78,14 +78,14 @@ uchar i;
}
usbDeviceConnect();
LED_PORT_DDR |= _BV(LED_BIT); /* make the LED bit an output */
- sei();
+ sei();
DBG1(0x01, 0, 0); /* debug output: main loop starts */
- for(;;){ /* main event loop */
+ for(;;){ /* main event loop */
DBG1(0x02, 0, 0); /* debug output: main loop iterates */
- wdt_reset();
- usbPoll();
- }
- return 0;
+ wdt_reset();
+ usbPoll();
+ }
+ return 0;
}
/* ------------------------------------------------------------------------- */