Update all demos, projects and bootloaders to indent all function parameters, one per line, for better readability.
Add missing const qualifiers to the demos.
This commit is contained in:
parent
83e293a6ec
commit
6bda628718
271 changed files with 1312 additions and 621 deletions
|
@ -154,7 +154,9 @@ USB_OSCompatibleIDDescriptor_t PROGMEM DevCompatIDs =
|
|||
SubCompatibleID: "UNIV1"}
|
||||
};
|
||||
|
||||
uint16_t CALLBACK_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);
|
||||
|
@ -207,11 +209,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
|
|||
return Size;
|
||||
}
|
||||
|
||||
bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex,
|
||||
void** const DescriptorAddress, uint16_t* const DescriptorSize)
|
||||
uint16_t USB_GetOSFeatureDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
void* Address = NULL;
|
||||
uint16_t Size = 0;
|
||||
uint16_t Size = NO_DESCRIPTOR;
|
||||
|
||||
/* Check if a device level OS feature descriptor is being requested */
|
||||
if (wValue == 0x0000)
|
||||
|
@ -224,13 +227,6 @@ bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex,
|
|||
}
|
||||
}
|
||||
|
||||
if (Address != NULL)
|
||||
{
|
||||
*DescriptorAddress = Address;
|
||||
*DescriptorSize = Size;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
*DescriptorAddress = Address;
|
||||
return Size;
|
||||
}
|
|
@ -85,11 +85,12 @@
|
|||
} USB_OSCompatibleIDDescriptor_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex,
|
||||
void** const DescriptorAddress, uint16_t* const DescriptorSize)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_WEAK ATTR_NON_NULL_PTR_ARG(3) ATTR_NON_NULL_PTR_ARG(4);
|
||||
uint16_t USB_GetOSFeatureDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -44,7 +44,7 @@ SideShow_Application_t* SideShow_GetFreeApplication(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* GUID)
|
||||
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* const GUID)
|
||||
{
|
||||
for (uint8_t App = 0; App < ARRAY_ELEMENTS(InstalledApplications); App++)
|
||||
{
|
||||
|
|
|
@ -57,6 +57,6 @@
|
|||
|
||||
/* Function Prototypes: */
|
||||
SideShow_Application_t* SideShow_GetFreeApplication(void);
|
||||
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* GUID);
|
||||
SideShow_Application_t* SideShow_GetApplicationFromGUID(GUID_t* const GUID);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -280,7 +280,8 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
|
|||
return;
|
||||
}
|
||||
|
||||
static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader, void* const UnicodeStruct)
|
||||
static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
|
||||
void* const UnicodeStruct)
|
||||
{
|
||||
Endpoint_ClearOUT();
|
||||
|
||||
|
|
|
@ -151,7 +151,8 @@
|
|||
static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader, void* const UnicodeStruct);
|
||||
static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
|
||||
void* const UnicodeStruct);
|
||||
static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const PacketHeader);
|
||||
static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader);
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
#include "SideshowCommon.h"
|
||||
|
||||
uint16_t SideShow_Read_Unicode_String(void* const UnicodeString, const uint16_t MaxBytes)
|
||||
uint16_t SideShow_Read_Unicode_String(void* const UnicodeString,
|
||||
const uint16_t MaxBytes)
|
||||
{
|
||||
Unicode_String_t* const UnicodeStruct = (Unicode_String_t*)UnicodeString;
|
||||
uint32_t UnicodeCharsToRead;
|
||||
|
|
|
@ -96,7 +96,8 @@
|
|||
} SideShow_PacketHeader_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t SideShow_Read_Unicode_String(void* UnicodeString, const uint16_t MaxBytes);
|
||||
uint16_t SideShow_Read_Unicode_String(void* UnicodeString,
|
||||
const uint16_t MaxBytes);
|
||||
void SideShow_Write_Unicode_String(void* UnicodeString);
|
||||
void SideShow_Discard_Byte_Stream(void);
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
#define INCLUDE_FROM_SIDESHOWCONTENT_C
|
||||
#include "SideshowContent.h"
|
||||
|
||||
bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader, SideShow_Application_t* const Application)
|
||||
bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
||||
SideShow_Application_t* const Application)
|
||||
{
|
||||
uint32_t ContentSize;
|
||||
uint32_t ContentID;
|
||||
|
@ -69,7 +70,8 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader, Side
|
|||
return true;
|
||||
}
|
||||
|
||||
static void SideShow_ProcessXMLContent(void* ContentData, uint32_t ContentSize)
|
||||
static void SideShow_ProcessXMLContent(void* ContentData,
|
||||
uint32_t ContentSize)
|
||||
{
|
||||
printf(" XML");
|
||||
Endpoint_Discard_Stream(ContentSize);
|
||||
|
|
|
@ -116,10 +116,12 @@
|
|||
#define XML_END_TAG "</body>"
|
||||
|
||||
/* Function Prototypes: */
|
||||
bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader, SideShow_Application_t* const Application);
|
||||
bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
|
||||
SideShow_Application_t* const Application);
|
||||
|
||||
#if defined(INCLUDE_FROM_SIDESHOWCONTENT_C)
|
||||
static void SideShow_ProcessXMLContent(void* ContentData, uint32_t ContentSize);
|
||||
static void SideShow_ProcessXMLContent(void* ContentData,
|
||||
uint32_t ContentSize);
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -122,13 +122,11 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
|||
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE))
|
||||
{
|
||||
void* DescriptorPointer;
|
||||
uint16_t DescriptorSize;
|
||||
uint16_t DescriptorSize = USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
|
||||
&DescriptorPointer, &DescriptorSize);
|
||||
|
||||
if (!(USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
|
||||
&DescriptorPointer, &DescriptorSize)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (DescriptorSize == NO_DESCRIPTOR)
|
||||
return;
|
||||
|
||||
Endpoint_ClearSETUP();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue