diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-13 06:43:17 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-13 06:43:17 +0000 |
commit | df5500e81cc40633eb5edee59410030f0aa77c2d (patch) | |
tree | 8277d2d9efb6f0e5396497ed309fd825e4359ee8 /Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c | |
parent | df29aa37c05ff0251bd17f54c750bac56d7279b7 (diff) | |
download | lufa-df5500e81cc40633eb5edee59410030f0aa77c2d.tar.gz lufa-df5500e81cc40633eb5edee59410030f0aa77c2d.tar.bz2 lufa-df5500e81cc40633eb5edee59410030f0aa77c2d.zip |
Added CDC_Device_Flush() command to the CDC Device mode class driver.
Minor updates to the unfinished SideShow demo for clarity.
Added unfinished MassStorageHost class driver demo.
Diffstat (limited to 'Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c')
-rw-r--r-- | Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c index 8dc0b6246..221ffb3f3 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c @@ -295,21 +295,26 @@ static void SideShow_GetString(SideShow_PacketHeader_t* PacketHeader, void* Unic static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* PacketHeader)
{
- uint8_t TotalInstalledApplications = SideShow_GetTotalApplications();
- uint16_t GadgetGUIDBytes = (TotalInstalledApplications * sizeof(GUID_t));
-
+ uint8_t TotalApplications = 0;
+
Endpoint_ClearOUT();
+ for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
+ {
+ if (InstalledApplications[App].InUse)
+ TotalApplications++;
+ }
+
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
- sizeof(uint32_t) + GadgetGUIDBytes;
+ sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
- Endpoint_Write_DWord_LE(TotalInstalledApplications);
+ Endpoint_Write_DWord_LE(TotalApplications);
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
{
- if (InstalledApplications[App].InUse == true)
+ if (InstalledApplications[App].InUse)
Endpoint_Write_Stream_LE(&InstalledApplications[App].ApplicationID, sizeof(GUID_t));
}
@@ -386,9 +391,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* PacketHeader) SideShow_Application_t* AppToDelete = SideShow_GetApplicationFromGUID(&ApplicationGUID);
if (AppToDelete != NULL)
- {
- AppToDelete->InUse = false;
- }
+ AppToDelete->InUse = false;
else
PacketHeader->Type.NAK = true;
|