aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-27 06:32:26 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-27 06:32:26 +0000
commit958d28d05dcf29530cc552ba75b53fc41bd89c7e (patch)
tree3f4e053071b9b7c1fcc82c41b5a4f63589a3aa4c /Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
parente5057fec8ead1ec52dbad3b128ed94f9895fc9f4 (diff)
downloadlufa-958d28d05dcf29530cc552ba75b53fc41bd89c7e.tar.gz
lufa-958d28d05dcf29530cc552ba75b53fc41bd89c7e.tar.bz2
lufa-958d28d05dcf29530cc552ba75b53fc41bd89c7e.zip
Better checking of whether a packet is received in the RNDISEthernetHost Class driver demo - show busy LED status while packets are being printed out.
Diffstat (limited to 'Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c')
-rw-r--r--Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
index 28d7b172d..02dd46a5d 100644
--- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
+++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
@@ -159,18 +159,21 @@ int main(void)
/** Prints incomming packets from the attached RNDIS device to the serial port. */
void PrintIncommingPackets(void)
{
- uint16_t PacketLength;
-
- RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, &PacketBuffer, &PacketLength);
-
- if (PacketLength)
+ if (RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface))
{
+ LEDs_SetAllLEDs(LEDMASK_USB_BUSY);
+
+ uint16_t PacketLength;
+ RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, &PacketBuffer, &PacketLength);
+
printf("***PACKET (Size %d)***\r\n", PacketLength);
for (uint16_t i = 0; i < PacketLength; i++)
printf("%02x ", PacketBuffer[i]);
- printf("\r\n\r\n");
+ printf("\r\n\r\n");
+
+ LEDs_SetAllLEDs(LEDMASK_USB_READY);
}
}