Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
ec079c71
Commit
ec079c71
authored
Jul 30, 2009
by
Dean Camera
Browse files
Minor cleanups to DualCDC ClassDriver device demo for clarity.
parent
41babf1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Demos/Device/ClassDriver/CDC/CDC.c
View file @
ec079c71
...
@@ -92,6 +92,7 @@ int main(void)
...
@@ -92,6 +92,7 @@ int main(void)
{
{
CheckJoystickMovement
();
CheckJoystickMovement
();
/* Must throw away unused bytes from the host, or it will lock up while waiting for the device */
while
(
CDC_Device_BytesReceived
(
&
VirtualSerial_CDC_Interface
))
while
(
CDC_Device_BytesReceived
(
&
VirtualSerial_CDC_Interface
))
CDC_Device_ReceiveByte
(
&
VirtualSerial_CDC_Interface
);
CDC_Device_ReceiveByte
(
&
VirtualSerial_CDC_Interface
);
...
...
Demos/Device/ClassDriver/DualCDC/DualCDC.c
View file @
ec079c71
...
@@ -99,13 +99,11 @@ int main(void)
...
@@ -99,13 +99,11 @@ int main(void)
CheckJoystickMovement
();
CheckJoystickMovement
();
/* Discard all received data on the first CDC interface */
/* Discard all received data on the first CDC interface */
uint16_t
BytesToDiscard
=
CDC_Device_BytesReceived
(
&
VirtualSerial1_CDC_Interface
);
while
(
CDC_Device_BytesReceived
(
&
VirtualSerial1_CDC_Interface
))
while
(
BytesToDiscard
--
)
CDC_Device_ReceiveByte
(
&
VirtualSerial1_CDC_Interface
);
CDC_Device_ReceiveByte
(
&
VirtualSerial1_CDC_Interface
);
/* Echo all received data on the second CDC interface */
/* Echo all received data on the second CDC interface */
uint16_t
BytesToEcho
=
CDC_Device_BytesReceived
(
&
VirtualSerial2_CDC_Interface
);
while
(
CDC_Device_BytesReceived
(
&
VirtualSerial2_CDC_Interface
))
while
(
BytesToEcho
--
)
CDC_Device_SendByte
(
&
VirtualSerial2_CDC_Interface
,
CDC_Device_ReceiveByte
(
&
VirtualSerial2_CDC_Interface
));
CDC_Device_SendByte
(
&
VirtualSerial2_CDC_Interface
,
CDC_Device_ReceiveByte
(
&
VirtualSerial2_CDC_Interface
));
CDC_Device_USBTask
(
&
VirtualSerial1_CDC_Interface
);
CDC_Device_USBTask
(
&
VirtualSerial1_CDC_Interface
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment