forked from mfulz_github/qmk_firmware
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
|
@ -201,7 +201,9 @@ USB_Descriptor_String_t ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -140,7 +140,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -143,7 +143,9 @@ USB_Descriptor_String_t ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -166,7 +166,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -271,7 +271,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -76,7 +76,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -271,7 +271,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -76,7 +76,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -338,7 +338,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -96,7 +96,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -189,7 +189,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -66,7 +66,8 @@
|
|||
#define GENERIC_REPORT_SIZE 8
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -143,8 +143,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
if (HIDReportEcho.ReportID)
|
||||
*ReportID = HIDReportEcho.ReportID;
|
||||
|
@ -163,8 +166,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
HIDReportEcho.ReportID = ReportID;
|
||||
HIDReportEcho.ReportSize = ReportSize;
|
||||
|
|
|
@ -72,9 +72,15 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -63,7 +63,9 @@
|
|||
#define JOYSTICK_EPSIZE 8
|
||||
|
||||
/* Function Prototypes: */
|
||||
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)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -137,8 +137,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;
|
||||
|
||||
|
@ -173,8 +176,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
|
||||
}
|
||||
|
|
|
@ -85,9 +85,15 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -63,7 +63,8 @@
|
|||
#define KEYBOARD_EPSIZE 8
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -178,8 +178,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
uint8_t LEDMask = LEDS_NO_LEDS;
|
||||
uint8_t* LEDReport = (uint8_t*)ReportData;
|
||||
|
|
|
@ -75,9 +75,15 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -275,7 +275,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -69,7 +69,8 @@
|
|||
#define HID_EPSIZE 8
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -165,8 +165,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
uint8_t JoyStatus_LCL = Joystick_GetStatus();
|
||||
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
|
||||
|
@ -232,8 +235,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
if (HIDInterfaceInfo == &Keyboard_HID_Interface)
|
||||
{
|
||||
|
|
|
@ -70,9 +70,15 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -283,7 +283,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -174,7 +174,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -66,7 +66,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
* \param[in] BlockAddress Data block starting address for the write sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
*/
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -181,7 +183,9 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
|
|||
* \param[in] BlockAddress Data block starting address for the read sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
*/
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -289,7 +293,9 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
|
|||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
* \param[in] BufferPtr Pointer to the data source RAM buffer
|
||||
*/
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -388,7 +394,9 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
|
|||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
* \param[out] BufferPtr Pointer to the data destination RAM buffer
|
||||
*/
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
|
|
@ -67,13 +67,17 @@
|
|||
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
|
||||
|
||||
/* Function Prototypes: */
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ResetDataflashProtections(void);
|
||||
bool DataflashManager_CheckDataflashOperation(void);
|
||||
|
|
|
@ -247,7 +247,8 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
|
|||
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
|
||||
* \param[in] IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
|
||||
*/
|
||||
static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead)
|
||||
static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const bool IsDataRead)
|
||||
{
|
||||
uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
|
||||
uint16_t TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
|
||||
|
|
|
@ -80,7 +80,8 @@
|
|||
static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead);
|
||||
static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const bool IsDataRead);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -254,7 +254,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -77,7 +77,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
* \param[in] BlockAddress Data block starting address for the write sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
*/
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -181,7 +183,9 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
|
|||
* \param[in] BlockAddress Data block starting address for the read sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
*/
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -289,7 +293,9 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
|
|||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
* \param[in] BufferPtr Pointer to the data source RAM buffer
|
||||
*/
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -388,7 +394,9 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
|
|||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
* \param[out] BufferPtr Pointer to the data destination RAM buffer
|
||||
*/
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
|
|
@ -70,13 +70,17 @@
|
|||
#define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS)
|
||||
|
||||
/* Function Prototypes: */
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
|
||||
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
|
||||
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ResetDataflashProtections(void);
|
||||
|
||||
|
|
|
@ -300,7 +300,8 @@ static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
|
|||
*
|
||||
* \return Boolean true if the command completed successfully, false otherwise.
|
||||
*/
|
||||
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead)
|
||||
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const bool IsDataRead)
|
||||
{
|
||||
uint32_t BlockAddress;
|
||||
uint16_t TotalBlocks;
|
||||
|
|
|
@ -81,7 +81,8 @@
|
|||
static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead);
|
||||
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
|
||||
const bool IsDataRead);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -185,8 +185,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
|
||||
|
||||
|
@ -223,8 +226,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
uint8_t LEDMask = LEDS_NO_LEDS;
|
||||
uint8_t* LEDReport = (uint8_t*)ReportData;
|
||||
|
|
|
@ -86,10 +86,15 @@
|
|||
|
||||
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -63,7 +63,8 @@
|
|||
#define MOUSE_EPSIZE 8
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -137,8 +137,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
|
||||
|
||||
|
@ -173,8 +176,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
|
||||
}
|
||||
|
|
|
@ -76,9 +76,15 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -212,7 +212,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -77,7 +77,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart)
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
DecodeARPHeader(InDataStart);
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
} ARP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart);
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,9 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart)
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
|
||||
void* DHCPHeaderInStart,
|
||||
void* DHCPHeaderOutStart)
|
||||
{
|
||||
IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
|
||||
DHCP_Header_t* DHCPHeaderIN = (DHCP_Header_t*)DHCPHeaderInStart;
|
||||
|
|
|
@ -120,6 +120,8 @@
|
|||
} DHCP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart);
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
|
||||
void* DHCPHeaderInStart,
|
||||
void* DHCPHeaderOutStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -56,7 +56,8 @@ const IP_Address_t ClientIPAddress = {CLIENT_IP_ADDRESS};
|
|||
/** Processes an incoming Ethernet frame, and writes the appropriate response to the output Ethernet
|
||||
* frame buffer if the sub protocol handlers create a valid response.
|
||||
*/
|
||||
void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_t* FrameOUT)
|
||||
void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
Ethernet_Frame_Info_t* const FrameOUT)
|
||||
{
|
||||
DecodeEthernetFrameHeader(FrameIN);
|
||||
|
||||
|
@ -115,7 +116,8 @@ void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_
|
|||
*
|
||||
* \return A 16-bit Ethernet checksum value
|
||||
*/
|
||||
uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes)
|
||||
uint16_t Ethernet_Checksum16(void* Data,
|
||||
uint16_t Bytes)
|
||||
{
|
||||
uint16_t* Words = (uint16_t*)Data;
|
||||
uint32_t Checksum = 0;
|
||||
|
|
|
@ -96,7 +96,9 @@
|
|||
extern const IP_Address_t ClientIPAddress;
|
||||
|
||||
/* Function Prototypes: */
|
||||
void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* FrameIN, Ethernet_Frame_Info_t* FrameOUT);
|
||||
uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes);
|
||||
void Ethernet_ProcessPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
Ethernet_Frame_Info_t* const FrameOUT);
|
||||
uint16_t Ethernet_Checksum16(void* Data,
|
||||
uint16_t Bytes);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,9 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart, void* OutDataStart)
|
||||
int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
ICMP_Header_t* ICMPHeaderIN = (ICMP_Header_t*)InDataStart;
|
||||
ICMP_Header_t* ICMPHeaderOUT = (ICMP_Header_t*)OutDataStart;
|
||||
|
|
|
@ -75,6 +75,8 @@
|
|||
} ICMP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart, void* OutDataStart);
|
||||
int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -47,7 +47,9 @@
|
|||
* response was generated, NO_PROCESS if the packet processing was deferred until the
|
||||
* next Ethernet packet handler iteration
|
||||
*/
|
||||
int16_t IP_ProcessIPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart, void* OutDataStart)
|
||||
int16_t IP_ProcessIPPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
DecodeIPHeader(InDataStart);
|
||||
|
||||
|
|
|
@ -90,6 +90,8 @@
|
|||
} IP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t IP_ProcessIPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart, void* OutDataStart);
|
||||
int16_t IP_ProcessIPPacket(Ethernet_Frame_Info_t* const FrameIN,
|
||||
void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
*
|
||||
* \param[in] FrameINData Pointer to the start of an Ethernet frame information structure
|
||||
*/
|
||||
void DecodeEthernetFrameHeader(Ethernet_Frame_Info_t* FrameINData)
|
||||
void DecodeEthernetFrameHeader(Ethernet_Frame_Info_t* const FrameINData)
|
||||
{
|
||||
#if !defined(NO_DECODE_ETHERNET)
|
||||
Ethernet_Frame_Header_t* FrameHeader = (Ethernet_Frame_Header_t*)FrameINData->FrameData;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "Ethernet.h"
|
||||
|
||||
/* Function Prototypes: */
|
||||
void DecodeEthernetFrameHeader(Ethernet_Frame_Info_t* FrameINData);
|
||||
void DecodeEthernetFrameHeader(Ethernet_Frame_Info_t* const FrameINData);
|
||||
void DecodeARPHeader(void* InDataStart);
|
||||
void DecodeIPHeader(void* InDataStart);
|
||||
void DecodeICMPHeader(void* InDataStart);
|
||||
|
|
|
@ -55,7 +55,7 @@ TCP_ConnectionState_t ConnectionStateTable[MAX_TCP_CONNECTIONS];
|
|||
* level. If an application produces a response, this task constructs the appropriate Ethernet frame and places it into the Ethernet OUT
|
||||
* buffer for later transmission.
|
||||
*/
|
||||
void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* RNDISInterfaceInfo)
|
||||
void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)
|
||||
{
|
||||
/* Run each application in sequence, to process incoming and generate outgoing packets */
|
||||
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
|
||||
|
@ -178,7 +178,9 @@ void TCP_Init(void)
|
|||
*
|
||||
* \return Boolean true if the port state was set, false otherwise (no more space in the port state table)
|
||||
*/
|
||||
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
|
||||
bool TCP_SetPortState(const uint16_t Port,
|
||||
const uint8_t State,
|
||||
void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -225,7 +227,7 @@ bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_Connecti
|
|||
*
|
||||
* \return A value from the TCP_PortStates_t enum
|
||||
*/
|
||||
uint8_t TCP_GetPortState(uint16_t Port)
|
||||
uint8_t TCP_GetPortState(const uint16_t Port)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -250,7 +252,10 @@ uint8_t TCP_GetPortState(uint16_t Port)
|
|||
*
|
||||
* \return Boolean true if the connection was updated or created, false otherwise (no more space in the connection state table)
|
||||
*/
|
||||
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State)
|
||||
bool TCP_SetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort,
|
||||
const uint8_t State)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -290,7 +295,9 @@ bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t
|
|||
*
|
||||
* \return A value from the TCP_ConnectionStates_t enum
|
||||
*/
|
||||
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
uint8_t TCP_GetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -317,7 +324,9 @@ uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16
|
|||
*
|
||||
* \return ConnectionInfo structure of the connection if found, NULL otherwise
|
||||
*/
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -346,7 +355,9 @@ TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAd
|
|||
* response was generated, NO_PROCESS if the packet processing was deferred until the
|
||||
* next Ethernet packet handler iteration
|
||||
*/
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart)
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart,
|
||||
void* TCPHeaderInStart,
|
||||
void* TCPHeaderOutStart)
|
||||
{
|
||||
IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
|
||||
TCP_Header_t* TCPHeaderIN = (TCP_Header_t*)TCPHeaderInStart;
|
||||
|
@ -593,8 +604,10 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
|
|||
*
|
||||
* \return A 16-bit TCP checksum value
|
||||
*/
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
|
||||
IP_Address_t DestinationAddress, uint16_t TCPOutSize)
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart,
|
||||
const IP_Address_t SourceAddress,
|
||||
const IP_Address_t DestinationAddress,
|
||||
const uint16_t TCPOutSize)
|
||||
{
|
||||
uint32_t Checksum = 0;
|
||||
|
||||
|
|
|
@ -228,18 +228,31 @@
|
|||
} TCP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* RNDISInterfaceInfo);
|
||||
void TCP_TCPTask(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);
|
||||
void TCP_Init(void);
|
||||
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
|
||||
uint8_t TCP_GetPortState(uint16_t Port);
|
||||
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State);
|
||||
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart);
|
||||
bool TCP_SetPortState(const uint16_t Port,
|
||||
const uint8_t State,
|
||||
void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
|
||||
uint8_t TCP_GetPortState(const uint16_t Port);
|
||||
bool TCP_SetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort,
|
||||
const uint8_t State);
|
||||
uint8_t TCP_GetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort);
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort);
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart,
|
||||
void* TCPHeaderInStart,
|
||||
void* TCPHeaderOutStart);
|
||||
|
||||
#if defined(INCLUDE_FROM_TCP_C)
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
|
||||
IP_Address_t DestinationAddress, uint16_t TCPOutSize);
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart,
|
||||
const IP_Address_t SourceAddress,
|
||||
const IP_Address_t DestinationAddress,
|
||||
uint16_t TCPOutSize);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,9 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart)
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart,
|
||||
void* UDPHeaderInStart,
|
||||
void* UDPHeaderOutStart)
|
||||
{
|
||||
UDP_Header_t* UDPHeaderIN = (UDP_Header_t*)UDPHeaderInStart;
|
||||
UDP_Header_t* UDPHeaderOUT = (UDP_Header_t*)UDPHeaderOutStart;
|
||||
|
|
|
@ -62,6 +62,8 @@
|
|||
} UDP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart);
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart,
|
||||
void* UDPHeaderInStart,
|
||||
void* UDPHeaderOutStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -90,7 +90,8 @@ void Webserver_Init(void)
|
|||
*
|
||||
* \return Boolean true if the command matches the request, false otherwise
|
||||
*/
|
||||
static bool IsHTTPCommand(uint8_t* RequestHeader, char* Command)
|
||||
static bool IsHTTPCommand(uint8_t* RequestHeader,
|
||||
char* Command)
|
||||
{
|
||||
/* Returns true if the non null terminated string in RequestHeader matches the null terminated string Command */
|
||||
return (strncmp((char*)RequestHeader, Command, strlen(Command)) == 0);
|
||||
|
@ -102,7 +103,8 @@ static bool IsHTTPCommand(uint8_t* RequestHeader, char* Command)
|
|||
* \param[in] ConnectionState Pointer to a TCP Connection State structure giving connection information
|
||||
* \param[in,out] Buffer Pointer to the application's send/receive packet buffer
|
||||
*/
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer)
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* const ConnectionState,
|
||||
TCP_ConnectionBuffer_t* const Buffer)
|
||||
{
|
||||
char* BufferDataStr = (char*)Buffer->Data;
|
||||
static uint8_t PageBlock = 0;
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
/* Function Prototypes: */
|
||||
void Webserver_Init(void);
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer);
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* const ConnectionState,
|
||||
TCP_ConnectionBuffer_t* const Buffer);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -224,7 +224,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -77,7 +77,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -311,7 +311,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -88,7 +88,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,8 +199,11 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
|
||||
*/
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize)
|
||||
{
|
||||
USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
|
||||
|
||||
|
@ -235,8 +238,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
|
|||
* \param[in] ReportData Pointer to a buffer where the created report has been stored
|
||||
* \param[in] ReportSize Size in bytes of the received HID report
|
||||
*/
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize)
|
||||
{
|
||||
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
|
||||
}
|
||||
|
|
|
@ -76,8 +76,14 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
|
||||
const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
|
||||
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
uint8_t* const ReportID,
|
||||
const uint8_t ReportType,
|
||||
void* ReportData,
|
||||
uint16_t* const ReportSize);
|
||||
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
|
||||
const uint8_t ReportID,
|
||||
const uint8_t ReportType,
|
||||
const void* ReportData,
|
||||
const uint16_t ReportSize);
|
||||
#endif
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -272,7 +272,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -312,7 +312,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -272,7 +272,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -312,7 +312,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -338,7 +338,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -110,7 +110,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -87,7 +87,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -141,7 +141,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
|||
*
|
||||
* \return Boolean true if the new report differs from the last report, false otherwise
|
||||
*/
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData)
|
||||
{
|
||||
static uint8_t PrevJoyStatus = 0;
|
||||
static uint8_t PrevButtonStatus = 0;
|
||||
|
|
|
@ -87,6 +87,6 @@
|
|||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* ReportData);
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -216,7 +216,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -92,7 +92,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -257,7 +257,7 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \param[out] ReportData Pointer to a HID report data structure to be filled
|
||||
*/
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData)
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* const ReportData)
|
||||
{
|
||||
uint8_t JoyStatus_LCL = Joystick_GetStatus();
|
||||
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
|
||||
|
@ -291,7 +291,7 @@ void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData)
|
|||
*
|
||||
* \param[in] LEDReport LED status report from the host
|
||||
*/
|
||||
void ProcessLEDReport(uint8_t LEDReport)
|
||||
void ProcessLEDReport(const uint8_t LEDReport)
|
||||
{
|
||||
uint8_t LEDMask = LEDS_LED2;
|
||||
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);
|
||||
void ProcessLEDReport(uint8_t LEDReport);
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* const ReportData);
|
||||
void ProcessLEDReport(const uint8_t LEDReport);
|
||||
void SendNextReport(void);
|
||||
void ReceiveNextReport(void);
|
||||
|
||||
|
|
|
@ -286,7 +286,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -98,7 +98,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue