aboutsummaryrefslogtreecommitdiffstats
path: root/examples/hid-mouse
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/hid-mouse
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/hid-mouse')
-rw-r--r--examples/hid-mouse/firmware/main.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/hid-mouse/firmware/main.c b/examples/hid-mouse/firmware/main.c
index 0f3fd42..7667fe7 100644
--- a/examples/hid-mouse/firmware/main.c
+++ b/examples/hid-mouse/firmware/main.c
@@ -97,7 +97,7 @@ char d;
/* ------------------------------------------------------------------------- */
-uchar usbFunctionSetup(uchar data[8])
+usbMsgLen_t usbFunctionSetup(uchar data[8])
{
usbRequest_t *rq = (void *)data;
@@ -119,16 +119,16 @@ usbRequest_t *rq = (void *)data;
}else{
/* no vendor specific requests implemented */
}
- 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!
*/
@@ -137,8 +137,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 */
@@ -146,20 +146,20 @@ uchar i;
_delay_ms(1);
}
usbDeviceConnect();
- 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();
+ wdt_reset();
+ usbPoll();
if(usbInterruptIsReady()){
/* called after every poll of the interrupt endpoint */
advanceCircleByFixedAngle();
DBG1(0x03, 0, 0); /* debug output: interrupt report prepared */
usbSetInterrupt((void *)&reportBuffer, sizeof(reportBuffer));
}
- }
- return 0;
+ }
+ return 0;
}
/* ------------------------------------------------------------------------- */