aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/CDC
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-03-23 05:43:49 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-03-23 05:43:49 +0000
commit350141e085d3dcc440962259314f569cc8fcef03 (patch)
tree15a5504a171a421d2217e8719c8937c79721a1bf /Demos/Device/CDC
parented031c1df2f5b053b9cd9f48c63e66a42b7c049e (diff)
downloadlufa-350141e085d3dcc440962259314f569cc8fcef03.tar.gz
lufa-350141e085d3dcc440962259314f569cc8fcef03.tar.bz2
lufa-350141e085d3dcc440962259314f569cc8fcef03.zip
Fixed CDC demo not sending an empty packet after each transfer to prevent the host from buffering incomming data.
Altered Project and Bootloader makefiles so that the path to the LUFA library can be set in one place.
Diffstat (limited to 'Demos/Device/CDC')
-rw-r--r--Demos/Device/CDC/CDC.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Demos/Device/CDC/CDC.c b/Demos/Device/CDC/CDC.c
index 6e933d581..d4eecc897 100644
--- a/Demos/Device/CDC/CDC.c
+++ b/Demos/Device/CDC/CDC.c
@@ -308,6 +308,12 @@ TASK(CDC_Task)
/* Finalize the stream transfer to send the last packet */
Endpoint_ClearCurrentBank();
+
+ /* Wait until the endpoint is ready for another packet */
+ while (!(Endpoint_ReadWriteAllowed()));
+
+ /* Send an empty packet to ensure that the host does not buffer data sent to it */
+ Endpoint_ClearCurrentBank();
}
/* Select the Serial Rx Endpoint */