projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix incorrect Event call name in USBInterrupt.c.
[pub/lufa.git]
/
Demos
/
Device
/
ClassDriver
/
DualCDC
/
DualCDC.c
diff --git
a/Demos/Device/ClassDriver/DualCDC/DualCDC.c
b/Demos/Device/ClassDriver/DualCDC/DualCDC.c
index
ca33f10
..
e5406a4
100644
(file)
--- a/
Demos/Device/ClassDriver/DualCDC/DualCDC.c
+++ b/
Demos/Device/ClassDriver/DualCDC/DualCDC.c
@@
-41,18
+41,21
@@
* within a device can be differentiated from one another. This is for the first CDC interface,
\r
* which sends strings to the host for each joystick movement.
\r
*/
\r
* within a device can be differentiated from one another. This is for the first CDC interface,
\r
* which sends strings to the host for each joystick movement.
\r
*/
\r
-USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =
\r
+USB_ClassInfo_CDC_
Device_
t VirtualSerial1_CDC_Interface =
\r
{
\r
{
\r
- .ControlInterfaceNumber = 0,
\r
+ .Config =
\r
+ {
\r
+ .ControlInterfaceNumber = 0,
\r
\r
\r
- .DataINEndpointNumber = CDC1_TX_EPNUM,
\r
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
\r
+
.DataINEndpointNumber = CDC1_TX_EPNUM,
\r
+
.DataINEndpointSize = CDC_TXRX_EPSIZE,
\r
\r
\r
- .DataOUTEndpointNumber = CDC1_RX_EPNUM,
\r
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
\r
+
.DataOUTEndpointNumber = CDC1_RX_EPNUM,
\r
+
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
\r
\r
\r
- .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,
\r
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
+ .NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,
\r
+ .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
+ },
\r
};
\r
\r
/** LUFA CDC Class driver interface configuration and state information. This structure is
\r
};
\r
\r
/** LUFA CDC Class driver interface configuration and state information. This structure is
\r
@@
-60,18
+63,21
@@
USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =
* within a device can be differentiated from one another. This is for the second CDC interface,
\r
* which echos back all received data from the host.
\r
*/
\r
* within a device can be differentiated from one another. This is for the second CDC interface,
\r
* which echos back all received data from the host.
\r
*/
\r
-USB_ClassInfo_CDC_t VirtualSerial2_CDC_Interface =
\r
+USB_ClassInfo_CDC_
Device_
t VirtualSerial2_CDC_Interface =
\r
{
\r
{
\r
- .ControlInterfaceNumber = 2,
\r
+ .Config =
\r
+ {
\r
+ .ControlInterfaceNumber = 2,
\r
\r
\r
- .DataINEndpointNumber = CDC2_TX_EPNUM,
\r
- .DataINEndpointSize = CDC_TXRX_EPSIZE,
\r
+
.DataINEndpointNumber = CDC2_TX_EPNUM,
\r
+
.DataINEndpointSize = CDC_TXRX_EPSIZE,
\r
\r
\r
- .DataOUTEndpointNumber = CDC2_RX_EPNUM,
\r
- .DataOUTEndpointSize = CDC_TXRX_EPSIZE,
\r
+
.DataOUTEndpointNumber = CDC2_RX_EPNUM,
\r
+
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
\r
\r
\r
- .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
\r
- .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
+ .NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
\r
+ .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
+ },
\r
};
\r
\r
/** Main program entry point. This routine contains the overall program flow, including initial
\r
};
\r
\r
/** Main program entry point. This routine contains the overall program flow, including initial
\r
@@
-88,13
+94,11
@@
int main(void)
CheckJoystickMovement();
\r
\r
/* Discard all received data on the first CDC interface */
\r
CheckJoystickMovement();
\r
\r
/* Discard all received data on the first CDC interface */
\r
- uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface);
\r
- while (BytesToDiscard--)
\r
+ while (CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface))
\r
CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
\r
\r
/* Echo all received data on the second CDC interface */
\r
CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
\r
\r
/* Echo all received data on the second CDC interface */
\r
- uint16_t BytesToEcho = CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface);
\r
- while (BytesToEcho--)
\r
+ while (CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface))
\r
CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface));
\r
\r
CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);
\r
CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface));
\r
\r
CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);
\r
@@
-128,7
+132,7
@@
void CheckJoystickMovement(void)
char* ReportString = NULL;
\r
static bool ActionSent = false;
\r
\r
char* ReportString = NULL;
\r
static bool ActionSent = false;
\r
\r
- char* JoystickStrings[] =
\r
+ char*
const
JoystickStrings[] =
\r
{
\r
"Joystick Up\r\n",
\r
"Joystick Down\r\n",
\r
{
\r
"Joystick Up\r\n",
\r
"Joystick Down\r\n",
\r
@@
-159,19
+163,19
@@
void CheckJoystickMovement(void)
}
\r
\r
/** Event handler for the library USB Connection event. */
\r
}
\r
\r
/** Event handler for the library USB Connection event. */
\r
-void EVENT_USB_Connect(void)
\r
+void EVENT_USB_
Device_
Connect(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
}
\r
\r
/** Event handler for the library USB Disconnection event. */
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
}
\r
\r
/** Event handler for the library USB Disconnection event. */
\r
-void EVENT_USB_Disconnect(void)
\r
+void EVENT_USB_D
evice_D
isconnect(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
\r
}
\r
\r
/** Event handler for the library USB Configuration Changed event. */
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
\r
}
\r
\r
/** Event handler for the library USB Configuration Changed event. */
\r
-void EVENT_USB_ConfigurationChanged(void)
\r
+void EVENT_USB_
Device_
ConfigurationChanged(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);
\r
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);
\r
\r
@@
-182,9
+186,9
@@
void EVENT_USB_ConfigurationChanged(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
\r
}
\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
\r
}
\r
\r
-/** Event handler for the library USB Unhandled Control
Packe
t event. */
\r
-void EVENT_USB_
UnhandledControlPacke
t(void)
\r
+/** Event handler for the library USB Unhandled Control
Reques
t event. */
\r
+void EVENT_USB_
Device_UnhandledControlReques
t(void)
\r
{
\r
{
\r
- CDC_Device_ProcessControl
Packe
t(&VirtualSerial1_CDC_Interface);
\r
- CDC_Device_ProcessControl
Packe
t(&VirtualSerial2_CDC_Interface);
\r
+ CDC_Device_ProcessControl
Reques
t(&VirtualSerial1_CDC_Interface);
\r
+ CDC_Device_ProcessControl
Reques
t(&VirtualSerial2_CDC_Interface);
\r
}
\r
}
\r