Commit f51017f8 authored by Dean Camera's avatar Dean Camera
Browse files

Conversion of old incomplete SideShow demo to new APIs.

parent bf041e8b
......@@ -154,7 +154,7 @@ USB_OSCompatibleIDDescriptor_t PROGMEM DevCompatIDs =
SubCompatibleID: "UNIV1"}
};
uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
......@@ -165,30 +165,30 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
switch (DescriptorType)
{
case DTYPE_Device:
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
Address = (void*)&DeviceDescriptor;
Size = sizeof(USB_Descriptor_Device_t);
break;
case DTYPE_Configuration:
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
Address = (void*)&ConfigurationDescriptor;
Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
switch (DescriptorNumber)
{
case 0x00:
Address = DESCRIPTOR_ADDRESS(LanguageString);
Address = (void*)&LanguageString;
Size = pgm_read_byte(&LanguageString.Header.Size);
break;
case 0x01:
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
Address = (void*)&ManufacturerString;
Size = pgm_read_byte(&ManufacturerString.Header.Size);
break;
case 0x02:
Address = DESCRIPTOR_ADDRESS(ProductString);
Address = (void*)&ProductString;
Size = pgm_read_byte(&ProductString.Header.Size);
break;
case 0x03:
Address = DESCRIPTOR_ADDRESS(SerialNumberString);
Address = (void*)&SerialNumberString;
Size = pgm_read_byte(&SerialNumberString.Header.Size);
break;
case 0xEE:
......@@ -197,7 +197,7 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
our device is Sideshow compatible. Most people would be happy using the normal
0xFF 0x?? 0x?? Class/Subclass/Protocol values like the USBIF intended. */
Address = DESCRIPTOR_ADDRESS(OSDescriptorString);
Address = (void*)&OSDescriptorString;
Size = pgm_read_byte(&OSDescriptorString.Header.Size);
break;
}
......@@ -221,7 +221,7 @@ bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex,
/* Only the Extended Device Compatibility descriptor is supported */
if (wIndex == EXTENDED_COMPAT_ID_DESCRIPTOR)
{
Address = DESCRIPTOR_ADDRESS(DevCompatIDs);
Address = (void*)&DevCompatIDs;
Size = sizeof(USB_OSCompatibleIDDescriptor_t);
}
}
......
......@@ -85,8 +85,8 @@
} USB_OSCompatibleIDDescriptor_t;
/* Function Prototypes: */
uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_WEAK ATTR_NON_NULL_PTR_ARG(3);
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
ATTR_WARN_UNUSED_RESULT ATTR_WEAK ATTR_NON_NULL_PTR_ARG(3);
bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex,
void** const DescriptorAddress, uint16_t* const DescriptorSize)
......
......@@ -48,162 +48,98 @@
constraints, new content can be requested as needed.
*/
/*
USB Mode: Device
USB Class: Sideshow Device (Microsoft Only)
USB Subclass: Bulk Only
Relevant Standards: Microsoft Sideshow Specification
Microsoft OS Descriptors Specification
XML Specification
Usable Speeds: Full Speed Mode
*/
#include "Sideshow.h"
/* Project Tags, for reading out using the ButtLoad project */
BUTTLOADTAG(ProjName, "LUFA Sideshow App");
BUTTLOADTAG(BuildTime, __TIME__);
BUTTLOADTAG(BuildDate, __DATE__);
BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
/* Scheduler Task List */
TASK_LIST
/** Main program entry point. This routine contains the overall program flow, including initial
* setup of all components and the main program loop.
*/
int main(void)
{
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
{ Task: USB_Sideshow , TaskStatus: TASK_STOP },
};
SetupHardware();
int main(void)
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
for (;;)
{
SideShow_Task();
USB_USBTask();
}
}
/** Configures the board hardware and chip peripherals for the demo's functionality. */
void SetupHardware(void)
{
/* Disable watchdog if enabled by bootloader/fuses */
MCUSR &= ~(1 << WDRF);
wdt_disable();
/* Disable Clock Division */
SetSystemClockPrescaler(0);
/* Disable clock division */
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
SerialStream_Init(9600, false);
LEDs_Init();
HWB_Init();
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDS_LED1 | LEDS_LED3);
/* Initialize Scheduler so that it can be used */
Scheduler_Init();
/* Initialize USB Subsystem */
USB_Init();
/* Scheduling - routine never returns, so put this last in the main function */
Scheduler_Start();
SerialStream_Init(9600, false);
}
EVENT_HANDLER(USB_Connect)
void EVENT_USB_Connect(void)
{
/* Start USB management task */
Scheduler_SetTaskMode(USB_USBTask, TASK_RUN);
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDS_LED1 | LEDS_LED4);
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
}
EVENT_HANDLER(USB_Disconnect)
void EVENT_USB_Disconnect(void)
{
/* Stop running mass storage and USB management tasks */
Scheduler_SetTaskMode(USB_Sideshow, TASK_STOP);
Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDS_LED1 | LEDS_LED3);
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
}
EVENT_HANDLER(USB_ConfigurationChanged)
void EVENT_USB_ConfigurationChanged(void)
{
/* Setup Sideshow In and Out Endpoints */
Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_IN, SIDESHOW_IO_EPSIZE,
ENDPOINT_BANK_SINGLE);
LEDs_SetAllLEDs(LEDMASK_USB_READY);
Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_OUT, SIDESHOW_IO_EPSIZE,
ENDPOINT_BANK_SINGLE);
/* Setup Sideshow In and Out Endpoints */
if (!(Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_IN, SIDESHOW_IO_EPSIZE,
ENDPOINT_BANK_SINGLE)))
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDS_LED2 | LEDS_LED4);
/* Start Sideshow task */
Scheduler_SetTaskMode(USB_Sideshow, TASK_RUN);
if (!(Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPNUM, EP_TYPE_BULK,
ENDPOINT_DIR_OUT, SIDESHOW_IO_EPSIZE,
ENDPOINT_BANK_SINGLE)))
{
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
}
EVENT_HANDLER(USB_UnhandledControlPacket)
void EVENT_USB_UnhandledControlPacket(void)
{
/* Process UFI specific control requests */
switch (bRequest)
switch (USB_ControlRequest.bRequest)
{
case REQ_GetOSFeatureDescriptor:
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE))
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE))
{
uint16_t wValue = Endpoint_Read_Word_LE();
uint16_t wIndex = Endpoint_Read_Word_LE();
uint16_t wLength = Endpoint_Read_Word_LE();
void* DescriptorPointer;
uint16_t DescriptorSize;
bool SendZLP = true;
if (!(USB_GetOSFeatureDescriptor(wValue, wIndex, &DescriptorPointer, &DescriptorSize)))
return;
Endpoint_ClearSetupReceived();
if (wLength > DescriptorSize)
wLength = DescriptorSize;
while (wLength && (!(Endpoint_IsSetupOUTReceived())))
{
while (!(Endpoint_IsSetupINReady()));
while (wLength && (Endpoint_BytesInEndpoint() < USB_ControlEndpointSize))
{
#if defined(USE_RAM_DESCRIPTORS)
Endpoint_Write_Byte(*((uint8_t*)DescriptorPointer++));
#elif defined (USE_EEPROM_DESCRIPTORS)
Endpoint_Write_Byte(eeprom_read_byte(DescriptorPointer++));
#else
Endpoint_Write_Byte(pgm_read_byte(DescriptorPointer++));
#endif
wLength--;
}
SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);
Endpoint_ClearSetupIN();
}
if (Endpoint_IsSetupOUTReceived())
if (!(USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
&DescriptorPointer, &DescriptorSize)))
{
Endpoint_ClearSetupOUT();
return;
}
if (SendZLP)
{
while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
while (!(Endpoint_IsSetupOUTReceived()));
Endpoint_ClearSetupOUT();
Endpoint_ClearSETUP();
Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);
Endpoint_ClearOUT();
}
break;
}
}
TASK(USB_Sideshow)
void SideShow_Task(void)
{
/* Check if the USB System is connected to a Host */
if (USB_IsConnected)
......@@ -212,7 +148,7 @@ TASK(USB_Sideshow)
Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
/* Check to see if a new SideShow message has been received */
if (Endpoint_ReadWriteAllowed())
if (Endpoint_IsReadWriteAllowed())
{
/* Process the received SideShow message */
Sideshow_ProcessCommandPacket();
......
......@@ -34,31 +34,40 @@
/* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include "Descriptors.h"
#include "SideshowCommands.h"
#include <LUFA/Version.h> // Library Version Information
#include <LUFA/Common/ButtLoadTag.h> // PROGMEM tags readable by the ButtLoad project
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
#include <LUFA/Drivers/Board/HWB.h> // HWB button driver
#include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
#include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
#include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
#include <LUFA/Drivers/AT90USBXXX/Serial_Stream.h> // Serial stream driver
#include <LUFA/Version.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
/* Macros: */
#define REQ_GetOSFeatureDescriptor 0x01
#define EXTENDED_COMPAT_ID_DESCRIPTOR 0x0004
/* Task Definitions: */
TASK(USB_Sideshow);
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
/* Event Handlers: */
HANDLES_EVENT(USB_Connect);
HANDLES_EVENT(USB_Disconnect);
HANDLES_EVENT(USB_ConfigurationChanged);
HANDLES_EVENT(USB_UnhandledControlPacket);
/* Function Prototypes: */
void SetupHardware(void);
void SideShow_Task(void);
void EVENT_USB_Connect(void);
void EVENT_USB_Disconnect(void);
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
#endif
......@@ -105,14 +105,14 @@ void Sideshow_ProcessCommandPacket(void)
PacketHeader.Length -= sizeof(SideShow_PacketHeader_t);
Endpoint_Discard_Stream(PacketHeader.Length);
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader.Length = sizeof(SideShow_PacketHeader_t);
PacketHeader.Type.NAK = true;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
printf(" UNK");
}
......@@ -120,11 +120,11 @@ void Sideshow_ProcessCommandPacket(void)
static void SideShow_Ping(SideShow_PacketHeader_t* PacketHeader)
{
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_Sync(SideShow_PacketHeader_t* PacketHeader)
......@@ -132,7 +132,7 @@ static void SideShow_Sync(SideShow_PacketHeader_t* PacketHeader)
GUID_t ProtocolGUID;
Endpoint_Read_Stream_LE(&ProtocolGUID, sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
if (memcmp(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID, sizeof(GUID_t)) != 0)
PacketHeader->Type.NAK = true;
......@@ -140,31 +140,31 @@ static void SideShow_Sync(SideShow_PacketHeader_t* PacketHeader)
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* PacketHeader)
{
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
SideShow_Write_Unicode_String(&UserSID);
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* PacketHeader)
{
SideShow_Read_Unicode_String(&UserSID, sizeof(UserSID.UnicodeString));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_GetCapabilities(SideShow_PacketHeader_t* PacketHeader)
......@@ -173,7 +173,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* PacketHeader)
SideShow_PropertyData_t PropertyData;
Endpoint_Read_Stream_LE(&Property, sizeof(SideShow_PropertyKey_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
printf(" ID: %lu", Property.PropertyID);
......@@ -276,13 +276,13 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* PacketHeader)
}
}
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
return;
}
static void SideShow_GetString(SideShow_PacketHeader_t* PacketHeader, void* UnicodeStruct)
{
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;
......@@ -290,7 +290,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* PacketHeader, void* Unic
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
SideShow_Write_Unicode_String(UnicodeStruct);
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* PacketHeader)
......@@ -298,7 +298,7 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* PacketHeader)
uint8_t TotalInstalledApplications = SideShow_GetTotalApplications();
uint16_t GadgetGUIDBytes = (TotalInstalledApplications * sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + GadgetGUIDBytes;
......@@ -313,14 +313,14 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* PacketHeader)
Endpoint_Write_Stream_LE(&InstalledApplications[App].ApplicationID, sizeof(GUID_t));
}
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* PacketHeader)
{
GUID_t SupportedEndpointGUID = (GUID_t){Chunks: SIMPLE_CONTENT_FORMAT_GUID};
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t);
......@@ -328,7 +328,7 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* PacketHeader
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_Write_DWord_LE(1);
Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_AddApplication(SideShow_PacketHeader_t* PacketHeader)
......@@ -348,7 +348,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* PacketHeader)
PacketHeader->Length -= sizeof(SideShow_PacketHeader_t) + sizeof(GUID_t);
Endpoint_Discard_Stream(PacketHeader->Length);
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Type.NAK = true;
}
......@@ -362,7 +362,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* PacketHeader)
SideShow_Discard_Byte_Stream();
SideShow_Discard_Byte_Stream();
SideShow_Discard_Byte_Stream();
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
CurrApp->InUse = true;
CurrApp->HaveContent = false;
......@@ -373,7 +373,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* PacketHeader)
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_DeleteApplication(SideShow_PacketHeader_t* PacketHeader)
......@@ -381,7 +381,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* PacketHeader)
GUID_t ApplicationGUID;
Endpoint_Read_Stream_LE(&ApplicationGUID, sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
SideShow_Application_t* AppToDelete = SideShow_GetApplicationFromGUID(&ApplicationGUID);
......@@ -396,19 +396,19 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* PacketHeader)
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* PacketHeader)
{
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
InstalledApplications[App].InUse = false;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_AddContent(SideShow_PacketHeader_t* PacketHeader)
......@@ -432,13 +432,13 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* PacketHeader)
PacketHeader->Type.NAK = true;
}
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_DeleteContent(SideShow_PacketHeader_t* PacketHeader)
......@@ -450,7 +450,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* PacketHeader)
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t));
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t));
Endpoint_Read_Stream_LE(&ContentID, sizeof(uint32_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
......@@ -463,7 +463,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* PacketHeader)
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* PacketHeader)
......@@ -473,7 +473,7 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* PacketHeader)
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t));
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearOUT();
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
......@@ -486,5 +486,5 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* PacketHeader)
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t));
Endpoint_ClearCurrentBank();
Endpoint_ClearIN();
}
# Hey Emacs, this is a -*- makefile -*-
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, Jrg Wunsch, et al.
# >> Modified for use with the LUFA project. <<
#
# Released to the Public Domain
#
......@@ -13,6 +14,9 @@
# Sander Pool
# Frederik Rouleau
# Carlos Lamas
# Dean Camera
# Opendous Inc.
# Denver Gingerich
#