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 | |
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')
3 files changed, 12 insertions, 23 deletions
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c index ad26d77b5..4f27c3336 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c @@ -33,19 +33,6 @@ SideShow_Application_t InstalledApplications[MAX_APPLICATIONS];
-uint8_t SideShow_GetTotalApplications(void)
-{
- uint8_t TotalInstalledApps = 0;
-
- for (uint8_t App = 0; App < ARRAY_ELEMENTS(InstalledApplications); App++)
- {
- if (InstalledApplications[App].InUse)
- TotalInstalledApps++;
- }
-
- return TotalInstalledApps;
-}
-
SideShow_Application_t* SideShow_GetFreeApplication(void)
{
for (uint8_t App = 0; App < ARRAY_ELEMENTS(InstalledApplications); App++)
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h index 133acf994..63e30111b 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h @@ -56,7 +56,6 @@ extern SideShow_Application_t InstalledApplications[MAX_APPLICATIONS];
/* Function Prototypes: */
- uint8_t SideShow_GetTotalApplications(void);
SideShow_Application_t* SideShow_GetFreeApplication(void);
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* GUID);
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;
|