diff --git a/Bootloaders/CDC/Descriptors.c b/Bootloaders/CDC/Descriptors.c index c7dcf5535eca1cd1f7b0e78cb89f55d888260cac..e808fcfe1e9167bf4c986106df7af2e372f8f6a4 100644 --- a/Bootloaders/CDC/Descriptors.c +++ b/Bootloaders/CDC/Descriptors.c @@ -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); diff --git a/Bootloaders/CDC/Descriptors.h b/Bootloaders/CDC/Descriptors.h index 845ab556589d1af68039c44f8c60e24ecfabe500..f8e557ccfbb7f782c15a5e68da40907fa54957d7 100644 --- a/Bootloaders/CDC/Descriptors.h +++ b/Bootloaders/CDC/Descriptors.h @@ -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 diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c index 1e9ec458763f6ba37f64c8806a2037370e425e27..4e7272cb714d0a529eb96918be3baf1dd3f9a921 100644 --- a/Bootloaders/DFU/Descriptors.c +++ b/Bootloaders/DFU/Descriptors.c @@ -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); diff --git a/Bootloaders/DFU/Descriptors.h b/Bootloaders/DFU/Descriptors.h index 3cf152639fa15dacb237b2e4ce883690f7a5a740..d89cc90463f78419731caa820cf1c3079d4c6f89 100644 --- a/Bootloaders/DFU/Descriptors.h +++ b/Bootloaders/DFU/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index 006e45b5b75f99ceb768ca6f3531f1dc95766a05..2a58064fbaaec051489ba8b907dbf727e56062ea 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.h b/Demos/Device/ClassDriver/AudioInput/Descriptors.h index 79825bd40fa5fd17b39026779f1f2d027e947f19..30249e9cb4c08df4644c5323269e0e786db00199 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c index a9a5f05a19181eedc276213330c4c3b25de39544..0fc52a667d3c08a626544094568c1c61afb4d87f 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h index ff7f0bbc6b8c2bae697c0a7f86aa371223a13bf6..4804c2c84fcdf7850ec027557dd2246a1763cd7c 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c index 5a89cc8b15e7f2417a2d43ac2374b34c86fa43e7..d50e27d4362a75a2355fd04580c16a670f1a86d2 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h index 8cebab3791414ee0e8570d6be472c66b4afc3b25..968ddd3752b6283e78a16cfd3154c7857f96c6c4 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index 35b655949b92d1efcc1d93b524e275521ffca514..b0413a6573379b76b59a225a1ebe8e5f37d624de 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.h b/Demos/Device/ClassDriver/GenericHID/Descriptors.h index 410e1954fb94952f729c80a16131f88774b27271..2192da6970c0c49aee8052f1c075ffaf1dff0a03 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.h +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index de01ef5800fcbaa4acc2e1f22d582889c447203f..8b51b765716c74a3b8d362c8bc535ed04c1cdf23 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -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; diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.h b/Demos/Device/ClassDriver/GenericHID/GenericHID.h index 6327958623e23730ab62bc27b34c7062a40fced1..8fa0b9354a4b34049a136048adbc5c1caae5ab19 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.h +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.h @@ -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 diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index ec46c3f512d5245a6e88212aeb40ca18b0a0de41..125297d5d28421cebdcfe2ffc26777d4ef47a05b 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.h b/Demos/Device/ClassDriver/Joystick/Descriptors.h index a80260c1a4ec399e61e27437f3cf45cbabab7dbe..fc8cbe537f242e941577d3f058a705cd70996cb5 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.h +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index 9c6311a17697a6d272a2df371b6dd7997a49a1ad..e2804d6e0c917005e0c732daf7c7c9d6eb1ab437 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -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 } diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.h b/Demos/Device/ClassDriver/Joystick/Joystick.h index 1cb3d9580b46ef37e4304130b304c97a0e1a5a07..fc06634ffcb6524aa3d13f630f1dd8121dbc92ed 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.h +++ b/Demos/Device/ClassDriver/Joystick/Joystick.h @@ -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 diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.h b/Demos/Device/ClassDriver/Keyboard/Descriptors.h index 7ea7f47a44d9f34d9633796f683043dd96a7f673..4100faabac2b13951b52263951d396ffce77e004 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index f194f397b99043285866c8c26d7ae30da7d97f3d..80f0ad98838e125034cc524b418c3a4bd9025883 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -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; diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.h b/Demos/Device/ClassDriver/Keyboard/Keyboard.h index df272e216df594f6a8993014f9ace4c765e0576a..4c4e2d5d8278f94e8c80e929b4a623ac16afc5f5 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.h +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.h @@ -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 diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index fa34436bde69e03825ab229e6675fe660de654df..c510ce629a37945248da3111673cdfe11111fdf8 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h index 3dd2ec7b91968cc3fee2d58f0bc2ed00721629da..b4bf3d27282a2976885d620853592152b59a7b7a 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index b032f8707ac7381fb11eca7dd466fa38c804802e..43634eac3bfb27578c3f7b00c27f4abafaac880d 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -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) { diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h index 34c1467ef1ac2d7f93ba1c3bcbc728811fa49865..9cbba7aaa1946b63ea71cd8e1ace24c9bc2d1fa5 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.h @@ -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 diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c index 640c83224407784f524d1cdb135367eed8ebec3e..9ce300afc5fb44256814a3ae5e23722b1232d083 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.c +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.h b/Demos/Device/ClassDriver/MIDI/Descriptors.h index 9933d060e5818a9eb616850b9133312262ae4ea1..fc648de4b2636f037030043430e346d30cd66c2d 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.h +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c index d7d41c5bbaed73dd27a1cca37058b4d48860bf43..b1744e685949040fbb2a54b2f9e12d9bb433fbb0 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.h b/Demos/Device/ClassDriver/MassStorage/Descriptors.h index a13ee013f515748614d705c1a902ef59afb96736..b7d15e48fefdfc9614d48fa149fc6fa8e510d570 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.c b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.c index bf0b33074f0cc418a289f20b9b3cfff7cbb2a5b1..64db4466c141710c7f3de7a91f79a2d9cc26897d 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.c +++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.c @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h index f3e1b65262d2ee79f005902067094f770316d832..f162c03b29f26367849cea87c64958b372886a71 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/DataflashManager.h @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c index 0bc92c1d4195a31d98def40caaa230af6249b06d..fcda46c033d7ca90f683fba2223842ca82946a45 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.c @@ -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]); diff --git a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h index dab3ebb001d87feb184b508e07d07453cf87819c..0c00cfb4ff410a1ec9281a94e3e4ad1d301bbf11 100644 --- a/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorage/Lib/SCSI.h @@ -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 diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index 4bd2e4885037a876a9cfe04c9d463bc3232f122f..f8c2ff744344f8f924ae631f233e9893e4822670 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h index 70b161d93d2ab8eef5a5d07747c9df88d13001e5..50c618664b350971031eeb7ed67e6002aa0be12f 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c index f3a0ea17c535d6cfdb96080cfb3e083517f49c3a..00016b0a2df268385b330fc9dd06d33d0485fba4 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h index 585af0ddcae06667d2fe761e9b845c85f1257c4d..f1f0ec734a84c82777688429bfd472e7d158f14c 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.h @@ -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); diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c index fb9bda1a814a6d16a0f726582ff08d189f9b4213..c55af622d16e90c2a76f956da7e270eef59eb8b0 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.c @@ -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; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h index 125bce40867c71e76a57cb0d22ca2cc226f586b0..6025d866f0efeccba09f930247647830687e9b6d 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/SCSI.h @@ -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 diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index 330252fc84d7d934cc1bbc85f1369ccab587e86f..2a6e3dd785505acf14e6f4d69de0685c1d80df7d 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -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; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h index a6a16d105073116338e379ce401968ffa3650292..6e1a0836880948942d63f2a24ee3c906cb8070df 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.h @@ -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 diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c index 703051e844588ff770bf394b4de71eff235d5a45..66db661c07d36f2731ec2016f11d45bcbfd3e1d6 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.c +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.h b/Demos/Device/ClassDriver/Mouse/Descriptors.h index 2c77d7841e0a8a9937ed09ceeab9984bfce324f0..59910dec4d9a25021eadb8b1c8e83e5c4f024916 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.h +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c index f2427362852f45af186e57a51ccdedf3866dbb42..19ca0132afe22bb45aceb1b5e6dccc274a0671eb 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.c +++ b/Demos/Device/ClassDriver/Mouse/Mouse.c @@ -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 } diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.h b/Demos/Device/ClassDriver/Mouse/Mouse.h index c3d9ce6942d508b2ad2bb7d76fcba867a0683549..9a3c6e55448a0fb374a028c50712fbac372a1e5e 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.h +++ b/Demos/Device/ClassDriver/Mouse/Mouse.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 4857892f22f58f8f200634dcf01a073605875fe8..21b4fbb4a1ad060f111cc9cb631a32365319ad3d 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h index 8e8cde25ebb93828977a914355117e4bb76825bf..7d6c3b99bbfbfb2be0107115be4256f009609f3d 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.c index 6cbc67f89d57cf75c3c08b19ef2aa9c0483027aa..18da19cdb2a58af3c6fedd185f25e0bbe79bbbad 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.c @@ -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); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.h index 6ae9b7be3e25c24a78ebdd6f7460e894977c9635..8de76f3b629aa383407884c7f610535d2232f5ca 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ARP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c index 761c6adf14420d656e43288b91403672ffeb1d0e..f694f2c8195c10c07bed661ccaaf9ebd388ea010 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.h index 2c8c4d8843f5d968a7e9e0db3f76bb45908e246b..3bfdb29be80c1f5a1b7bb7ea4025f22f4f4d2fc9 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c index e34f824e93ed33412c87ab3628d6e9de9d17cb27..5f396234c2c73ef75cd26cff0abddd270a86819e 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h index f8b8bffdea259fe731b54f2d85d3c4c9d00171e9..233f48d1b875621213d27ae3ef7b75117264da0b 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Ethernet.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c index fa1a651e6ea048e8ec700bb8d9b9d1fef317abc1..fec74b37bdfc675ed57c6fe47124d9a18bcfe363 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.h index 4fe42957c11510643b9b644a803b941c0895a829..9982560b1795d3d2070844c8cccade2e5eeb445e 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.c index 6766322ca48334ef04cd258660e438545852cb8a..6f49eac88d32fdf5989452824b258ec032aa24a9 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.c @@ -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); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h index ede537acefeb06ec7a2f2a8ea5d29c4a8c59d738..215695756f057540ace8a9e1df35cf05e7b807c5 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/IP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.c index e0bf6ecfe9cb361f531c4e7c94043a633eb447ac..676bf7a94d697e4f8b60adf7186af08af7d3b1fb 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h index 56ed795e6a75f33330eeb112a8e9b053d42be1c8..c1d3b395dd13df6f750ae654efa1832e12e06ae7 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.h @@ -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); diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c index 6b62edb13a901435641a0d88b6a7901a375df6be..e0c581f59933a22a5469c29900c211f4b2be2af4 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h index ac144150c2c7fbd22a09d378d6e2d59bf807e44d..d412647eb60fc95f00f61b8b23eca9206011a57a 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/TCP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c index c9c523f71b0e28cea4040fb7c6ec2f01ecace174..15b0656562f48364d0308477a4c6ea0ee2d70cd0 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.h index ee90522752a97ac5b19ca5215b49f887a5c1a8da..57abd0dc7568c7610d408bad779b9d65057de2f2 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/UDP.h @@ -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 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.c index 7f90de3b8bfe9a1158104404f1d44fc2a295aaeb..e01a04fb4b66353af1bcbb0af3c7d0471d59367b 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.c @@ -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; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.h b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.h index 3ba4186ea11d79d1e024df2f9025af10f4c1a0c5..87fe1c91d1000002c6aaf4f1f2f977e9c0d66c53 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/Webserver.h @@ -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 diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c index 97b66de9b4a2698c736a74592b380c6b80c28bf6..8f11d4a26b4136a6a2b617ba3369a98b709dfb29 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h index 017e3fe1ef5cefa5c616a9714168ad85a4de702b..387034f11d04c4349a423f81416ccf582f473fc6 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c index f91fa4c934deb2cb7f7f8cd87afdd3a1f07562d5..83fe2fe8e82b24d28c0dfdbca305e246628cda33 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c @@ -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); diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h index f4733c2b537d68c5d7d055d35ffb5461a7027f3a..82b3ed1d67bbb88213b569ab0db09170fb80860c 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h @@ -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 diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index 313f6c036acc5902a95d844cacff681c1ca236a3..8db86b84a265ff527cdeb4105d681cdc4974e051 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -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 } diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h index 64d04ec27c245e5ac7126291b0c7cc028c29cd11..64ad52299f3db5fb40a00993bd2b9f57573d42c7 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.h @@ -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 diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.c b/Demos/Device/Incomplete/Sideshow/Descriptors.c index f6d16c8412bd55c5deffb9508a1e522d95248d1d..e05358e68c3fbf09326767eca5b189b06bcaf88b 100644 --- a/Demos/Device/Incomplete/Sideshow/Descriptors.c +++ b/Demos/Device/Incomplete/Sideshow/Descriptors.c @@ -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; } \ No newline at end of file diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.h b/Demos/Device/Incomplete/Sideshow/Descriptors.h index 83c683be5ceab6a10e31ccdc76e5fb330c355f95..4d672c0cebb8a276cf3b63b0a49401ab199effb0 100644 --- a/Demos/Device/Incomplete/Sideshow/Descriptors.h +++ b/Demos/Device/Incomplete/Sideshow/Descriptors.h @@ -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 diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c index a6c529e69da5d5f95e3c5d603d7ed096fbcf027d..e8631be8e6add260c8897e21d2ccf771710ea757 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.c @@ -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++) { diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h index ed885d40da3bd493299e3ea0c4f0b0d3cf597db5..9624c7c345c80a66d749cdc18b46c8ce32481f58 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowApplications.h @@ -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 diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c index 5bce088c895e7759fda47f832d7a6c2fc0a99fa6..827deb0a428ec996f2408718d709317dafdff091 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c @@ -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(); diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h index 6d4ad4c26c272bf77c188bd27ca9aa290eaf530d..1395cd36753d0d44dacf8b10fc6b5ee026238b1c 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.h @@ -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); diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.c index 29f768ecc7b933d6156201fd30e02a85274d091b..02b681c50ddc0fd2b1a49b2048d20c7cf6cf8235 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.c @@ -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; diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h index 7c632b3c4ca9de4a456bf94827bccd932a9bc952..b801ecfa5ac56db5532e72c58cb02aea71347411 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommon.h @@ -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); diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.c index 0d1dd80fb02f013298c892a8d43ceed6d2671997..5bfae1b494b23dbea8d4361a4597a253cf960d03 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.c +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.c @@ -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); diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h index 97a6bee817335d6a58813127630e359f69124946..6e3031c1383a15a34093795eed5d93cc6dc4bdd9 100644 --- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h +++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowContent.h @@ -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 \ No newline at end of file diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c index 3e9778e29ae1a2c4e0324b4697819ef9c937eea5..2972e0cf721215728293802884a089c7eaa7dbe8 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.c +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c @@ -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(); diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c index 414c7666b454502af760fde87d6c1c048b5f0435..cfe1fd03f9b8286de46a3b4d0f506eeacd49cbc6 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.h b/Demos/Device/LowLevel/AudioInput/Descriptors.h index 443cd1a10ab456c029b78a78c651c835fede2055..91c1d56080014e90bea30676ca6b2347368e5422 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index bcde7f9829be818f1329142e0407393d75881685..414bae8d4a95c286e5d29503249f95793f17c148 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index 87c75941cd4e8b5e1b26305747b3d1434a3b42c6..ea9b9f0258055f6a4c42e2de1cdba2de9fecd948 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c index a7d64a4e3c0b74d5b292dfc0809cb608bfd20188..a134813b7cad7b3e1cd7f8976b2e963802b0d398 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h index f69c8c64c04138cf2ec1d5847d26c36dee58f98c..61941b1682ee2d9d7611473fb5274ea964c25ee6 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c index 12ff1f01e0182defcdf0e5d3f1f5ec7f312caf61..0d83fe1eec2d28778a82a601b216167f2835a0bc 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.c +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.h b/Demos/Device/LowLevel/GenericHID/Descriptors.h index 0babc226946d90e89af1c0d171928c8878e2b8e2..8e9e37b29993c34b4ed9b8d7be287c286f0d5e9c 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.h +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c index a1e35fe6e856db7bd3b90704b1f43c3f875841b8..45e771eacba315248ddb40ac9fa77467da9888c7 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.c +++ b/Demos/Device/LowLevel/Joystick/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.h b/Demos/Device/LowLevel/Joystick/Descriptors.h index a3144c4cc6b36a32f676a95897fd9dd1670364ef..c133f0b2c34ffb4ea727e7c3d0d14f66fe652a21 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.h +++ b/Demos/Device/LowLevel/Joystick/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 6ced1ce44e255497de38b15452e18a44a25e5b6d..561914a5c5836ccfd3465d4c63e464ddc8d0bc3b 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -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; diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index 3d876befce740d1ae266b7674f0c2770ca3126f0..607f56ec9278e4d44680e06c2cdc6156dc3c597a 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -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 diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.c b/Demos/Device/LowLevel/Keyboard/Descriptors.c index 598616a6a20aee304bccf8c38ef5bebe586d659d..6a2dfb5c764387092b6e45159eb2f46936877cf4 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.c +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.h b/Demos/Device/LowLevel/Keyboard/Descriptors.h index d4d7a9870d1537157d148f3dceb85237b4973563..d4b9ebf79531f45842e1dfbc3032f4a8ffa5b17c 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.h +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index c581626494dfaf8f4bc83ad947f5c1edc7f87c39..71b586176bf94119291db32ac1a381e5ea6e25c4 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -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; diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.h b/Demos/Device/LowLevel/Keyboard/Keyboard.h index a3c3bd40728dde2c71b9e0ec3c24639b38844091..e5904b8d6cc94c24a450fbf03ce1692ab357d49c 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.h +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.h @@ -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); diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c index e09e3c857a417eaf855103b02c2a2a637bbb69c6..a5505ea7c334f8c7876dc5215116618e008ed610 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h index f23ef3696b6b15bde3b31834c32a11beea4816ee..f76d5c9b2ad8569bf4884345e36c6e514711b114 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c index cc1f2efd96aa383d72ec14feb6c2ac3a1b103cbe..a6d73a32485bd36550d01832c6876ff67b47750e 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.c +++ b/Demos/Device/LowLevel/MIDI/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.h b/Demos/Device/LowLevel/MIDI/Descriptors.h index 70686102e7b7efc2966a9f8cd97e0778adabb8a1..afb74c68261d11fa63768f9d02281f1c8c57c043 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.h +++ b/Demos/Device/LowLevel/MIDI/Descriptors.h @@ -183,7 +183,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 diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c index d7d41c5bbaed73dd27a1cca37058b4d48860bf43..b1744e685949040fbb2a54b2f9e12d9bb433fbb0 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.c +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h index 6d468f6bfedf699aa134f06529b76c52df8f8b95..ce1c03c2890cd161ed92a505e84c027e3e2b673d 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -65,7 +65,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 diff --git a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.c b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.c index aedfcc715f2822dcd46bfd41013578b097945a34..07926ccd07ac1a2d9d366b29da3521140fa3a8b7 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.c +++ b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.c @@ -46,7 +46,8 @@ * \param[in] BlockAddress Data block starting address for the write sequence * \param[in] TotalBlocks Number of blocks of data to write */ -void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks) +void DataflashManager_WriteBlocks(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); @@ -179,7 +180,8 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo * \param[in] BlockAddress Data block starting address for the read sequence * \param[in] TotalBlocks Number of blocks of data to read */ -void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks) +void DataflashManager_ReadBlocks(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); @@ -287,7 +289,9 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc * \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); @@ -386,7 +390,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); diff --git a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h index 330666641169ba833c015603b722c6f30df50762..7a62ace04608df537970638172a2bc45466a0da9 100644 --- a/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h +++ b/Demos/Device/LowLevel/MassStorage/Lib/DataflashManager.h @@ -74,11 +74,15 @@ #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) /* Function Prototypes: */ - void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks); - void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks); - void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, + void DataflashManager_WriteBlocks(const uint32_t BlockAddress, + uint16_t TotalBlocks); + void DataflashManager_ReadBlocks(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); diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.c b/Demos/Device/LowLevel/Mouse/Descriptors.c index f7fc2f7149034bf899872d8fc17a0a75cbabbfbb..46533eeed7505d4ece2a788a0d65e7c4bf593474 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.c +++ b/Demos/Device/LowLevel/Mouse/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.h b/Demos/Device/LowLevel/Mouse/Descriptors.h index 21c394ff12dc1de1d98039b0c628c4616de61ae8..eb7246883ad988567a566b8f6db0d9cf3c896bc3 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.h +++ b/Demos/Device/LowLevel/Mouse/Descriptors.h @@ -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 diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 7e38e7afd4c810dc08eb7cde12e57aafd7b27dd2..97aa55ff4be3617ac5e5a969cf5dd763eabd8504 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -226,7 +226,7 @@ void EVENT_USB_Device_StartOfFrame(void) * * \param[out] ReportData Pointer to a HID report data structure to be filled */ -void CreateMouseReport(USB_MouseReport_Data_t* ReportData) +void CreateMouseReport(USB_MouseReport_Data_t* const ReportData) { uint8_t JoyStatus_LCL = Joystick_GetStatus(); uint8_t ButtonStatus_LCL = Buttons_GetStatus(); diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index e818f8005f5284166c8a5b03062a959b13c868ae..56766a6dfe58d7249698d2055c44603d59e4add7 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -107,6 +107,6 @@ void EVENT_USB_Device_UnhandledControlRequest(void); void EVENT_USB_Device_StartOfFrame(void); - void CreateMouseReport(USB_MouseReport_Data_t* ReportData); + void CreateMouseReport(USB_MouseReport_Data_t* const ReportData); #endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c index c823d443f632284eb31c2ec00432fb97f287aa98..d7ad8f22faaa1914f9216cba017711f3ec230b70 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h index 43a83e8e107abd09ffcf7210bda62e4d42951f6c..144fc9054e2e6648b9ada36a55683e3f453b34f3 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h @@ -91,7 +91,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 diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.c index 6eb74faff124affb2b518196cba4d113e889109c..853d505424d938d1f487006b5a06a2fcad43bef5 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.c @@ -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); diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.h index 6ae9b7be3e25c24a78ebdd6f7460e894977c9635..8de76f3b629aa383407884c7f610535d2232f5ca 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ARP.h @@ -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 diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c index eeed88491ae7c633e6bd41f146c993ee312bf5cd..41265aa275c89f748393c49209c0eb1f4820d4ca 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c @@ -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; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.h index 2c8c4d8843f5d968a7e9e0db3f76bb45908e246b..3bfdb29be80c1f5a1b7bb7ea4025f22f4f4d2fc9 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.h @@ -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 diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c index 044b0695b1de06ca05fa41651585c07c17a493fb..0b9563347f1ca4a79bf5a34c77c1de9f9a31c5c9 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.c @@ -120,7 +120,8 @@ void Ethernet_ProcessPacket(void) * * \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; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h index 683b187c3e5b14298d089f0bfe045e176676d921..49c6b1c257e662fcd95306c350c383e547b343e5 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Ethernet.h @@ -109,6 +109,7 @@ /* Function Prototypes: */ void Ethernet_ProcessPacket(void); - uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes); + uint16_t Ethernet_Checksum16(void* Data, + uint16_t Bytes); #endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c index a43ffca54cdca1bea6db51b41ab76d9bcd86d640..7e4be9c3d16be5fe9ee524744bec7f05eedecd87 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c @@ -45,7 +45,8 @@ * * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise */ -int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart) +int16_t ICMP_ProcessICMPPacket(void* InDataStart, + void* OutDataStart) { ICMP_Header_t* ICMPHeaderIN = (ICMP_Header_t*)InDataStart; ICMP_Header_t* ICMPHeaderOUT = (ICMP_Header_t*)OutDataStart; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.h index dfffae249f219616b4880f9d605ea53d3904a427..dcea1ada4e84517a215649b3a7ee9a2875f9f681 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.h @@ -75,6 +75,7 @@ } ICMP_Header_t; /* Function Prototypes: */ - int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart); + int16_t ICMP_ProcessICMPPacket(void* InDataStart, + void* OutDataStart); #endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.c index 078f5b58f6772c0d352e1d9fdda5491964c1cf27..85ccf426edc7e1edce1fa46e51c9fa2750262486 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.c @@ -46,7 +46,8 @@ * response was generated, NO_PROCESS if the packet processing was deferred until the * next Ethernet packet handler iteration */ -int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart) +int16_t IP_ProcessIPPacket(void* InDataStart, + void* OutDataStart) { DecodeIPHeader(InDataStart); diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h index b0a06b8d04945812ee6318a625b873ce95f25319..8f45113be362840bc9a2824945b4885e51f33c9e 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/IP.h @@ -90,6 +90,7 @@ } IP_Header_t; /* Function Prototypes: */ - int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart); + int16_t IP_ProcessIPPacket(void* InDataStart, + void* OutDataStart); #endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.c index 80b8bc8130609d44e5ccf32c22a8bfb13b20f809..3875f8801c88ab40395ff44952ac762ecef5c30f 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.c @@ -239,7 +239,7 @@ void ProcessRNDISControlMessage(void) * * \return Boolean true if the query was handled, false otherwise */ -static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize, +static bool ProcessNDISQuery(const uint32_t OId, void* QueryData, uint16_t QuerySize, void* ResponseData, uint16_t* ResponseSize) { /* Handler for REMOTE_NDIS_QUERY_MSG messages */ diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h index cabea97bb5022bc4daa31f873ec334cfe739bfd6..5168dc8ef74f72eed09c676b7babaed86467732b 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.h @@ -215,9 +215,14 @@ void ProcessRNDISControlMessage(void); #if defined(INCLUDE_FROM_RNDIS_C) - static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize, - void* ResponseData, uint16_t* ResponseSize); - static bool ProcessNDISSet(uint32_t OId, void* SetData, uint16_t SetSize); + static bool ProcessNDISQuery(const uint32_t OId, + void* QueryData, + uint16_t QuerySize, + void* ResponseData, + uint16_t* ResponseSize); + static bool ProcessNDISSet(const uint32_t OId, + void* SetData, + uint16_t SetSize); #endif #endif diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c index 76031490dc2598daec46bfa6c154dcb9744695af..f75b828bc3cdd8e64849651f62470d4dc48a4cc9 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.c @@ -175,7 +175,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 */ @@ -222,7 +224,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 */ @@ -247,7 +249,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 */ @@ -287,7 +292,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 */ @@ -314,7 +321,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 */ @@ -343,7 +352,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; @@ -590,8 +601,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, + uint16_t TCPOutSize) { uint32_t Checksum = 0; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h index 1e9b99bb1e564fc69055dc1c52198bf984bc2c9e..984793e59bd89932edf143db795dafc3183acc4a 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/TCP.h @@ -231,16 +231,29 @@ /* Function Prototypes: */ void TCP_Init(void); void TCP_Task(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 diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c index c9c523f71b0e28cea4040fb7c6ec2f01ecace174..15b0656562f48364d0308477a4c6ea0ee2d70cd0 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.c @@ -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; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.h index 6cbc0b8195ef52ce2c028c4c798a29f9edaec982..42d7925a320f3d274370e5d2e55ffa9fc67e34c0 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/UDP.h @@ -65,6 +65,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 diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c index 51a9fadec92c30b9760afbbc4f4350653f18bdd4..807c1a2e31ff8b1e4a3aa726cfe04b99de573199 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c @@ -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; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.h b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.h index 3ba4186ea11d79d1e024df2f9025af10f4c1a0c5..87fe1c91d1000002c6aaf4f1f2f977e9c0d66c53 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.h @@ -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 diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c index a9c044df90753d985dcc17cfff0ceb612150a418..1e87766eaf70d4dde7fee12be818883238d5ec11 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c @@ -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); diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h index 3ca71f5ddffbeac0078ab8599a0443eb0bb50a99..2b06da0a68704efd6423199b33c88dc75db29755 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h @@ -91,7 +91,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 diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c index 703051e844588ff770bf394b4de71eff235d5a45..66db661c07d36f2731ec2016f11d45bcbfd3e1d6 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c @@ -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); diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h index 2c77d7841e0a8a9937ed09ceeab9984bfce324f0..59910dec4d9a25021eadb8b1c8e83e5c4f024916 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h @@ -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 diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c index 6ec88aea3e4785cf89369c574888cedf5b12ba43..e2a2128e9391d3afce4bec14511b1145e6faecb5 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c @@ -104,8 +104,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; @@ -140,8 +143,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 } diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.h b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.h index f96d0aea135f908af2e7e07bc389484982a99d9e..90db85f170f70f458febd7f5dad320e7ead9d3c6 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.h @@ -43,10 +43,16 @@ extern USB_ClassInfo_HID_Device_t Mouse_HID_Device_Interface; /* Function Prototypes: */ - 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); void EVENT_USB_Device_Connect(void); void EVENT_USB_Device_Disconnect(void); diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c index bb9286bbe14b1b520a0eb42f709bd7009356e8d6..dfd67ae62e31daff87e7680e9b875d2ac5a8efa7 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c @@ -93,7 +93,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.h b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.h index 63f64ffd383e0669e3e8290416d062a818d792a7..fe5214e0a5c00f89d661021800fca72eb658620a 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.h @@ -48,7 +48,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 8f0b4053317d590acd93422c866db454bcd61433..f1b4cac7b07f672a94cea9503cec122110927696 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -231,7 +231,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -250,7 +251,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8 * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { bool IsJoystick = false; diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h index da667e6329af9bb96eb6678baf713966c5760df7..1cebb924c165c40368a6b94ce403b3202d310fc6 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.h @@ -85,9 +85,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index 8ae7d8312680286b76b8961021a2e50a93db8308..8bdf2b6ec4f912d821552b9b2037706ad06f402a 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -211,7 +211,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h index 948ff6a990787d42ec993b26d354b478b92592bb..fd6b83882dd77fa8439a1db0ccdcdb4e7068522e 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.h @@ -70,7 +70,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index dedf12fc467f0691c976c62f4803e6265096937c..9d28e7136b345198fdcb471377135bcd10f595f2 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -237,7 +237,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -256,7 +257,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8 * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { /* Check the attributes of the current item - see if we are interested in it or not; * only store KEYBOARD usage page items into the Processed HID Report structure to diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h index 8a0aeffd61bb28f5926fe2d04675e9f5bd8db5c3..5ecfdf4585b28c246e00250a122a056a9c628403 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -73,9 +73,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index 108c807c64d6b0e17afca18ae1de07fbdf568907..faaebdd7c4176684302fb6d6be0fc6dce9b6e023 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -252,7 +252,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h index f33ecb750493d260dbd5333d5006eb605e5dc5c7..84e7680f34aef3406e39d71eb89c0ffd49e56839 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.h @@ -73,7 +73,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 697da3420943cfa3be726e959105606d531f423b..40cf2a48d39384c904bee38c161fd8d08b6b8ead 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -289,7 +289,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h index 0cd98978178e5679bd23185600c3167ad02f39c7..b99471205f19861cdbfb7ff8d83b009dad41ae10 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.h @@ -74,7 +74,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index 6edceb08dc06312a8ee0ea68030526573fb2df10..a03381cc6a928d33c477b492e0946de25c9864a1 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -207,7 +207,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.h b/Demos/Host/ClassDriver/MouseHost/MouseHost.h index ccbaa82136f096d11b8c86f3041078f21c4ae700..7664580cb42ec35b24b3526bd154d2bedeb0184e 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.h +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.h @@ -70,7 +70,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index ef7835e54eac12f9417781cb66028ccf554f48b7..111bed48e7f0dd90925b2c03e4062539da07984b 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -240,7 +240,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -259,7 +260,7 @@ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8 * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { bool IsMouse = false; diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h index 342dff79aae526b70086b23c50520400c0017976..3b26cead55552ebdb74fabc5987fbbb6cbcd5a3a 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.h @@ -88,9 +88,10 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c index 9d5ca08d9a8f86f572bb0b53f277ac5f78f354af..e0d9726b6e74b0eae84fc5bdaa58a62ced2abe63 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c @@ -211,7 +211,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h index a4880577e8e1e609ab79d297d4af2283ecfe0d81..a2b90a69d55c75370a671d19c56d6dec622ccb9a 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.h @@ -73,7 +73,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c index 589faebcad7b3e91dfd39f58863f30aa630b337a..b793db92855044b23266fc2ff03c8508520edda1 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c @@ -236,7 +236,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h index 06f5ec2f053f0d6b0a20ffa9dbd91d2b03a778fa..f3c04f593d71f9a0d031a0df2ca1b40c6ba62fbe 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h @@ -74,7 +74,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index 8f91d81f1e2293e533235a46075f13dcc0d0881b..152639fef8eca96fd6aa4f6a4a8fb99116595e23 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -205,7 +205,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h index 5c163ef54b172c65b7e019fcce6011c3922ba8e8..1b776596bb4a2cb38ad0566a64cbd14c9490cd82 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.h @@ -70,7 +70,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index e6403ecdfc6bebb8bd8b304c2f2c4f9b62cdfe02..543e098252fa4a92b52b08c63d45192ee9c1d91d 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -182,7 +182,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h index bd5cd6ad655c84d9ccfe0885973284908747ddf8..ed4ffcef7a93f07dda6392f396bd7a4d197abefa 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.h @@ -70,7 +70,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c index 55c399778a291f587d042beef0c5b7312aabcf23..8301e85bd05c2128140fe108defe6074b7f2a339 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c @@ -123,7 +123,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h index e0de59ae251778fe9588855007d5ee99293fba83..0814845a05904d4f4432e59ad4439554f056e3ab 100644 --- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h +++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.h @@ -79,7 +79,8 @@ void EVENT_USB_Host_DeviceUnattached(void); void EVENT_USB_Host_DeviceEnumerationComplete(void); void EVENT_USB_Host_HostError(const uint8_t ErrorCode); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); /* Function Prototypes: */ void SetupHardware(void); diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c index 68a02d48b7505bcfe0607bb9ab0722e44380eb57..939b2ae5f6b69162f60920b9129416a42d10798d 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c @@ -211,7 +211,8 @@ static void Bluetooth_ProcessIncomingACLPackets(void) * * \return Pointer to the matching channel information structure in the channel table if found, NULL otherwise */ -Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, const uint8_t SearchKey) +Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, + const uint8_t SearchKey) { for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++) { @@ -253,7 +254,9 @@ Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, const * * \return A value from the \ref BT_SendPacket_ErrorCodes_t enum */ -uint8_t Bluetooth_SendPacket(void* Data, const uint16_t DataLen, Bluetooth_Channel_t* const ACLChannel) +uint8_t Bluetooth_SendPacket(void* Data, + const uint16_t DataLen, + Bluetooth_Channel_t* const ACLChannel) { BT_ACL_Header_t ACLPacketHeader; BT_DataPacket_Header_t DataHeader; diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c index 0db17a263e5b88e4eecd6c486122b4169dad9dd5..7f6f8b78d309ba973f3c6ca15a5b4a204c152347 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.c @@ -374,7 +374,9 @@ void Bluetooth_HCITask(void) * * \return A value from the USB_Host_SendControlErrorCodes_t enum. */ -static uint8_t Bluetooth_SendHCICommand(const BT_HCICommand_Header_t* const HCICommandHeader, const void* Parameters, const uint16_t ParameterLength) +static uint8_t Bluetooth_SendHCICommand(const BT_HCICommand_Header_t* const HCICommandHeader, + const void* Parameters, + const uint16_t ParameterLength) { /* Need to reserve the amount of bytes given in the header for the complete payload */ uint8_t CommandBuffer[sizeof(BT_HCICommand_Header_t) + HCICommandHeader->ParameterLength]; diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h index 5a556e1141916ec887c3f7d6084acd69d48d1373..9476446f651708f8c1540c58d6f9ecaaf792cbcc 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothHCICommands.h @@ -204,7 +204,8 @@ void Bluetooth_HCITask(void); #if defined(INCLUDE_FROM_BLUETOOTHHCICOMMANDS_C) - static uint8_t Bluetooth_SendHCICommand(const BT_HCICommand_Header_t* const HCICommandHeader, const void* Parameters, + static uint8_t Bluetooth_SendHCICommand(const BT_HCICommand_Header_t* const HCICommandHeader, + const void* Parameters, const uint16_t ParameterLength); #endif diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h index f47bf1e0a11c21b65bfa3930490d757002399a35..6f1ea67424be5813b966f7f5047180a9169afc91 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h @@ -155,13 +155,17 @@ void Bluetooth_ConnectionComplete(void); void Bluetooth_DisconnectionComplete(void); bool Bluetooth_ChannelConnectionRequest(const uint16_t PSM); - void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const ACLChannel); + void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, + Bluetooth_Channel_t* const ACLChannel); void Bluetooth_ChannelOpened(Bluetooth_Channel_t* const ACLChannel); - Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, const uint8_t SearchKey); + Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, + const uint8_t SearchKey); Bluetooth_Channel_t* Bluetooth_OpenChannel(const uint16_t PSM); void Bluetooth_CloseChannel(Bluetooth_Channel_t* const ACLChannel); - uint8_t Bluetooth_SendPacket(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const ACLChannel); + uint8_t Bluetooth_SendPacket(void* Data, + uint16_t DataLen, + Bluetooth_Channel_t* const ACLChannel); /* External Variables: */ extern Bluetooth_Device_t Bluetooth_DeviceConfiguration; diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c index d091676aad16aa77512418d3c6ee6469d8db6f78..f74002a07656e6a6c7b39ab1b9ac4987a62ab915 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c @@ -118,7 +118,8 @@ void RFCOMM_ServiceChannels(Bluetooth_Channel_t* const ACLChannel) * \param[in] Data Incoming packet data containing the RFCOMM packet * \param[in] ACLChannel ACL channel the request was issued to by the remote device */ -void RFCOMM_ProcessPacket(void* Data, Bluetooth_Channel_t* const ACLChannel) +void RFCOMM_ProcessPacket(void* Data, + Bluetooth_Channel_t* const ACLChannel) { const RFCOMM_Header_t* FrameHeader = (const RFCOMM_Header_t*)Data; const uint8_t* FrameData = (const uint8_t*)Data + sizeof(RFCOMM_Header_t); @@ -154,7 +155,8 @@ void RFCOMM_ProcessPacket(void* Data, Bluetooth_Channel_t* const ACLChannel) * \param[in] RFCOMMChannel RFCOMM logical channel whose local terminal signals have changed * \param[in] ACLChannel ACL channel which has been opened to carry RFCOMM traffic between devices */ -void RFCOMM_SendChannelSignals(const RFCOMM_Channel_t* const RFCOMMChannel, Bluetooth_Channel_t* const ACLChannel) +void RFCOMM_SendChannelSignals(const RFCOMM_Channel_t* const RFCOMMChannel, + Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, ">> MSC Command"); BT_RFCOMM_DEBUG(2, "-- DLCI 0x%02X", RFCOMMChannel->DLCI); @@ -184,7 +186,9 @@ void RFCOMM_SendChannelSignals(const RFCOMM_Channel_t* const RFCOMMChannel, Blue * \param[in] RFCOMMChannel RFCOMM logical channel which is to be transmitted to * \param[in] ACLChannel ACL channel which has been opened to carry RFCOMM traffic between devices */ -void RFCOMM_SendData(const uint16_t DataLen, const uint8_t* Data, const RFCOMM_Channel_t* const RFCOMMChannel, +void RFCOMM_SendData(const uint16_t DataLen, + const uint8_t* Data, + const RFCOMM_Channel_t* const RFCOMMChannel, Bluetooth_Channel_t* const ACLChannel) { if (RFCOMMChannel->State != RFCOMM_Channel_Open) @@ -263,8 +267,12 @@ uint16_t RFCOMM_GetVariableFieldValue(const uint8_t** BufferPos) return (((uint16_t)SecondOctet << 7) | FirstOctet >> 1); } -void RFCOMM_SendFrame(const uint8_t DLCI, const bool CommandResponse, const uint8_t Control, const uint16_t DataLen, - const void* Data, Bluetooth_Channel_t* const ACLChannel) +void RFCOMM_SendFrame(const uint8_t DLCI, + const bool CommandResponse, + const uint8_t Control, + const uint16_t DataLen, + const void* Data, + Bluetooth_Channel_t* const ACLChannel) { struct { @@ -304,7 +312,8 @@ void RFCOMM_SendFrame(const uint8_t DLCI, const bool CommandResponse, const uint Bluetooth_SendPacket(&ResponsePacket, sizeof(ResponsePacket), ACLChannel); } -static uint8_t RFCOMM_GetFCSValue(const void* FrameStart, uint8_t Length) +static uint8_t RFCOMM_GetFCSValue(const void* FrameStart, + uint8_t Length) { uint8_t FCS = 0xFF; @@ -315,13 +324,15 @@ static uint8_t RFCOMM_GetFCSValue(const void* FrameStart, uint8_t Length) return ~FCS; } -static void RFCOMM_ProcessDM(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessDM(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< DM Received"); BT_RFCOMM_DEBUG(2, "-- DLCI 0x%02X", FrameAddress->DLCI); } -static void RFCOMM_ProcessDISC(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessDISC(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< DISC Received"); BT_RFCOMM_DEBUG(2, "-- DLCI 0x%02X", FrameAddress->DLCI); @@ -336,7 +347,8 @@ static void RFCOMM_ProcessDISC(const RFCOMM_Address_t* const FrameAddress, Bluet RFCOMM_SendFrame(FrameAddress->DLCI, true, (RFCOMM_Frame_UA | FRAME_POLL_FINAL), 0, NULL, ACLChannel); } -static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< SABM Received"); BT_RFCOMM_DEBUG(2, "-- DLCI 0x%02X", FrameAddress->DLCI); @@ -375,14 +387,17 @@ static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, Bluet } } -static void RFCOMM_ProcessUA(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessUA(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< UA Received"); BT_RFCOMM_DEBUG(2, "-- DLCI 0x%02X", FrameAddress->DLCI); } -static void RFCOMM_ProcessUIH(const RFCOMM_Address_t* const FrameAddress, const uint16_t FrameLength, - const uint8_t* FrameData, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessUIH(const RFCOMM_Address_t* const FrameAddress, + const uint16_t FrameLength, + const uint8_t* FrameData, + Bluetooth_Channel_t* const ACLChannel) { if (FrameAddress->DLCI == RFCOMM_CONTROL_DLCI) { diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h index 5d22e38250e9a0bfb9039ce4c540890b85211886..7b74f4fab3bb5d7d2aa1d7c46420f20fe1b50745 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h @@ -102,33 +102,48 @@ /* Function Prototypes: */ void RFCOMM_Initialize(void); void RFCOMM_ServiceChannels(Bluetooth_Channel_t* const ACLChannel); - void RFCOMM_ProcessPacket(void* Data, Bluetooth_Channel_t* const ACLChannel); + void RFCOMM_ProcessPacket(void* Data, + Bluetooth_Channel_t* const ACLChannel); void RFCOMM_SendChannelSignals(const RFCOMM_Channel_t* const RFCOMMChannel, Bluetooth_Channel_t* const ACLChannel); - void RFCOMM_SendData(const uint16_t DataLen, const uint8_t* Data, + void RFCOMM_SendData(const uint16_t DataLen, + const uint8_t* Data, const RFCOMM_Channel_t* const RFCOMMChannel, Bluetooth_Channel_t* const ACLChannel); void RFCOMM_ChannelOpened(RFCOMM_Channel_t* const RFCOMMChannel); - void RFCOMM_DataReceived(RFCOMM_Channel_t* const RFCOMMChannel, uint16_t DataLen, const uint8_t* Data); + void RFCOMM_DataReceived(RFCOMM_Channel_t* const RFCOMMChannel, + uint16_t DataLen, + const uint8_t* Data); void RFCOMM_ChannelSignalsReceived(RFCOMM_Channel_t* const RFCOMMChannel); RFCOMM_Channel_t* RFCOMM_GetFreeChannelEntry(const uint8_t DLCI); RFCOMM_Channel_t* RFCOMM_GetChannelData(const uint8_t DLCI); uint16_t RFCOMM_GetVariableFieldValue(const uint8_t** BufferPos); - void RFCOMM_SendFrame(const uint8_t DLCI, const bool CommandResponse, const uint8_t Control, - const uint16_t DataLen, const void* Data, Bluetooth_Channel_t* const ACLChannel); + void RFCOMM_SendFrame(const uint8_t DLCI, + const bool CommandResponse, + const uint8_t Control, + const uint16_t DataLen, + const void* Data, + Bluetooth_Channel_t* const ACLChannel); #if defined(INCLUDE_FROM_RFCOMM_C) - static uint8_t RFCOMM_GetFCSValue(const void* FrameStart, uint8_t Length); + static uint8_t RFCOMM_GetFCSValue(const void* FrameStart, + uint8_t Length); - static void RFCOMM_ProcessDM(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessDISC(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessUA(const RFCOMM_Address_t* const FrameAddress, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessUIH(const RFCOMM_Address_t* const FrameAddress, const uint16_t FrameLength, - const uint8_t* FrameData, Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessDM(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessDISC(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessUA(const RFCOMM_Address_t* const FrameAddress, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessUIH(const RFCOMM_Address_t* const FrameAddress, + const uint16_t FrameLength, + const uint8_t* FrameData, + Bluetooth_Channel_t* const ACLChannel); #endif #endif diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c index 0f829eab56f7c8d5561d22cec88e73ba079bf2de..5bd8845720f7c6131af61b48a8c1852c391c6029 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c @@ -38,7 +38,8 @@ #define INCLUDE_FROM_RFCOMM_CONTROL_C #include "RFCOMMControl.h" -void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* const ACLChannel) +void RFCOMM_ProcessControlCommand(const uint8_t* Command, + Bluetooth_Channel_t* const ACLChannel) { const RFCOMM_Command_t* CommandHeader = (const RFCOMM_Command_t*)Command; const uint8_t* CommandData = (const uint8_t*)Command + sizeof(RFCOMM_Command_t); @@ -73,8 +74,10 @@ void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* c } } -static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen, - const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t CommandDataLen, + const uint8_t* CommandData, + Bluetooth_Channel_t* const ACLChannel) { const uint8_t* Params = (const uint8_t*)CommandData; @@ -98,20 +101,24 @@ static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeade RFCOMM_SendFrame(RFCOMM_CONTROL_DLCI, false, RFCOMM_Frame_UIH, sizeof(TestResponse), &TestResponse, ACLChannel); } -static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, +static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< FCE Command"); } -static void RFCOMM_ProcessFCDCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, +static void RFCOMM_ProcessFCDCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< FCD Command"); } -static void RFCOMM_ProcessMSCCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen, - const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) +static void RFCOMM_ProcessMSCCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t CommandDataLen, + const uint8_t* CommandData, + Bluetooth_Channel_t* const ACLChannel) { const RFCOMM_MSC_Parameters_t* Params = (const RFCOMM_MSC_Parameters_t*)CommandData; @@ -168,19 +175,22 @@ static void RFCOMM_ProcessMSCCommand(const RFCOMM_Command_t* const CommandHeader } } -static void RFCOMM_ProcessRPNCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, +static void RFCOMM_ProcessRPNCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< RPN Command"); } -static void RFCOMM_ProcessRLSCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, +static void RFCOMM_ProcessRLSCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) { BT_RFCOMM_DEBUG(1, "<< RLS Command"); } -static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, +static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel) { const RFCOMM_DPN_Parameters_t* Params = (const RFCOMM_DPN_Parameters_t*)CommandData; diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h index d47715f8044e5d0e406513b7b008cde11deef7d4..b527bfa7c22ff19103a5a87ea007f3a0b6fa7d57 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h @@ -115,22 +115,32 @@ } RFCOMM_MSC_Parameters_t; /* Function Prototypes: */ - void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* const Channel); + void RFCOMM_ProcessControlCommand(const uint8_t* Command, + Bluetooth_Channel_t* const Channel); #if defined(INCLUDE_FROM_RFCOMM_CONTROL_C) - static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen, - const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, + static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t CommandDataLen, + const uint8_t* CommandData, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessFCDCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, + static void RFCOMM_ProcessFCDCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessMSCCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen, - const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessRPNCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, + static void RFCOMM_ProcessMSCCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t CommandDataLen, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessRLSCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, + static void RFCOMM_ProcessRPNCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); - static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData, + static void RFCOMM_ProcessRLSCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, + Bluetooth_Channel_t* const ACLChannel); + static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader, + const uint8_t* CommandData, Bluetooth_Channel_t* const ACLChannel); #endif diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c index eb501f7096d6ff45b5407adf13b5615363efb1c2..e0522f9943ba6f8e0a9b2003c3ca2cd06ceadd76 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c @@ -88,7 +88,8 @@ void SDP_ProcessPacket(void* Data, Bluetooth_Channel_t* const Channel) * \param[in] SDPHeader Pointer to the start of the issued SDP request * \param[in] Channel Pointer to the Bluetooth channel structure the request was issued to */ -static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel) +static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel) { const void* CurrentParameter = ((const void*)SDPHeader + sizeof(SDP_PDUHeader_t)); @@ -169,7 +170,8 @@ static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, Blu * \param[in] SDPHeader Pointer to the start of the issued SDP request * \param[in] Channel Pointer to the Bluetooth channel structure the request was issued to */ -static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel) +static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel) { const void* CurrentParameter = ((const void*)SDPHeader + sizeof(SDP_PDUHeader_t)); @@ -259,7 +261,8 @@ static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, * \param[in] SDPHeader Pointer to the start of the issued SDP request * \param[in] Channel Pointer to the Bluetooth channel structure the request was issued to */ -static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel) +static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel) { const void* CurrentParameter = ((const void*)SDPHeader + sizeof(SDP_PDUHeader_t)); @@ -348,8 +351,10 @@ static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHe * * \return Number of bytes added to the output buffer */ -static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t* AttributeTable, uint16_t AttributeList[][2], - const uint8_t TotalAttributes, void** const BufferPos) +static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t* AttributeTable, + uint16_t AttributeList[][2], + const uint8_t TotalAttributes, + void** const BufferPos) { uint16_t TotalResponseSize; @@ -396,7 +401,9 @@ static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t* * * \return Number of bytes added to the response buffer */ -static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, const void* AttributeValue, void** ResponseBuffer) +static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, + const void* AttributeValue, + void** ResponseBuffer) { /* Retrieve the size of the attribute value from its container header */ uint8_t AttributeHeaderLength; @@ -424,7 +431,8 @@ static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, const voi * * \return Pointer to the start of the Attribute's value if found within the table, NULL otherwise */ -static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable, const uint16_t AttributeID) +static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable, + const uint16_t AttributeID) { void* CurrTableItemData; @@ -449,7 +457,8 @@ static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable * * \return True if all the UUIDs given in the UUID list appear in the given attribute table, false otherwise */ -static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, +static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], + const uint8_t TotalUUIDs, const ServiceAttributeTable_t* CurrAttributeTable) { const void* CurrAttribute; @@ -481,8 +490,10 @@ static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const ui * * \return True if all the UUIDs given in the UUID list appear in the given attribute table, false otherwise */ -static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, - uint16_t* const UUIDMatchFlags, const void* CurrAttribute) +static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], + const uint8_t TotalUUIDs, + uint16_t* const UUIDMatchFlags, + const void* CurrAttribute) { uint8_t CurrAttributeType = (pgm_read_byte(CurrAttribute) & ~0x07); @@ -536,7 +547,8 @@ static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_ * * \return Total number of Attribute ranges stored in the Data Element Sequence */ -static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], const void** const CurrentParameter) +static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], + const void** const CurrentParameter) { uint8_t ElementHeaderSize; uint8_t TotalAttributes = 0; @@ -578,7 +590,8 @@ static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], const void** co * * \return Total number of UUIDs stored in the Data Element Sequence */ -static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], const void** const CurrentParameter) +static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], + const void** const CurrentParameter) { uint8_t ElementHeaderSize; uint8_t TotalUUIDs = 0; @@ -629,7 +642,8 @@ static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], const void** * * \return Size in bytes of the entire attribute container, including the header */ -static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeData, uint8_t* const HeaderSize) +static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeData, + uint8_t* const HeaderSize) { /* Fetch the size of the Data Element structure from the header */ uint8_t SizeIndex = (pgm_read_byte(AttributeData) & 0x07); @@ -668,7 +682,8 @@ static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeDa * * \return Size in bytes of the Data Element container's contents, minus the header */ -static uint32_t SDP_GetDataElementSize(const void** const DataElementHeader, uint8_t* const ElementHeaderSize) +static uint32_t SDP_GetDataElementSize(const void** const DataElementHeader, + uint8_t* const ElementHeaderSize) { /* Fetch the size of the Data Element structure from the header, increment the current buffer pos */ uint8_t SizeIndex = (SDP_ReadData8(DataElementHeader) & 0x07); diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h index 548f3d5579e1187a4af63dd966f048ec84bdb56b..2df8c225d7f55b1b63947d5643ff184484246054 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h @@ -110,7 +110,8 @@ * \param[in, out] BufferPos Current position in the buffer where the data is to be written to * \param[in] Data Data to write to the buffer */ - static inline void SDP_WriteData8(void** BufferPos, uint8_t Data) + static inline void SDP_WriteData8(void** BufferPos, + const uint8_t Data) { *((uint8_t*)*BufferPos) = Data; *BufferPos += sizeof(uint8_t); @@ -121,7 +122,8 @@ * \param[in, out] BufferPos Current position in the buffer where the data is to be written to * \param[in] Data Data to write to the buffer */ - static inline void SDP_WriteData16(void** BufferPos, uint16_t Data) + static inline void SDP_WriteData16(void** BufferPos, + const uint16_t Data) { *((uint16_t*)*BufferPos) = SwapEndian_16(Data); *BufferPos += sizeof(uint16_t); @@ -132,7 +134,8 @@ * \param[in, out] BufferPos Current position in the buffer where the data is to be written to * \param[in] Data Data to write to the buffer */ - static inline void SDP_WriteData32(void** BufferPos, uint32_t Data) + static inline void SDP_WriteData32(void** BufferPos, + const uint32_t Data) { *((uint32_t*)*BufferPos) = SwapEndian_32(Data); *BufferPos += sizeof(uint32_t); @@ -203,28 +206,44 @@ } /* Function Prototypes: */ - void SDP_ProcessPacket(void* Data, Bluetooth_Channel_t* const Channel); + void SDP_ProcessPacket(void* Data, + Bluetooth_Channel_t* const Channel); #if defined(INCLUDE_FROM_SERVICEDISCOVERYPROTOCOL_C) - static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel); - static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel); - static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHeader, Bluetooth_Channel_t* const Channel); - - static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t* AttributeTable, uint16_t AttributeList[][2], - const uint8_t TotalAttributes, void** const BufferPos); - static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, const void* AttributeValue, void** ResponseBuffer); - static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable, const uint16_t AttributeID); - - static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, + static void SDP_ProcessServiceSearch(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel); + static void SDP_ProcessServiceAttribute(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel); + static void SDP_ProcessServiceSearchAttribute(const SDP_PDUHeader_t* const SDPHeader, + Bluetooth_Channel_t* const Channel); + + static uint16_t SDP_AddListedAttributesToResponse(const ServiceAttributeTable_t* AttributeTable, + uint16_t AttributeList[][2], + const uint8_t TotalAttributes, + void** const BufferPos); + static uint16_t SDP_AddAttributeToResponse(const uint16_t AttributeID, + const void* AttributeValue, + void** ResponseBuffer); + static void* SDP_GetAttributeValue(const ServiceAttributeTable_t* AttributeTable, + const uint16_t AttributeID); + + static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], + const uint8_t TotalUUIDs, const ServiceAttributeTable_t* CurrAttributeTable); - static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, - uint16_t* const UUIDMatchFlags, const void* CurrAttribute); - - static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], const void** const CurrentParameter); - static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], const void** const CurrentParameter); - - static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeData, uint8_t* const HeaderSize); - static uint32_t SDP_GetDataElementSize(const void** const AttributeHeader, uint8_t* const ElementHeaderSize); + static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], + const uint8_t TotalUUIDs, + uint16_t* const UUIDMatchFlags, + const void* CurrAttribute); + + static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], + const void** const CurrentParameter); + static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], + const void** const CurrentParameter); + + static uint32_t SDP_GetLocalAttributeContainerSize(const void* const AttributeData, + uint8_t* const HeaderSize); + static uint32_t SDP_GetDataElementSize(const void** const AttributeHeader, + uint8_t* const ElementHeaderSize); #endif #endif diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c index f477ac276883e82105d9ba63afc6bab0557e4548..66a5b8e7eefe38617966fd71ad6a22e484a26be2 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -165,11 +166,14 @@ void ReadNextReport(void) /** Writes a report to the attached device. * * \param[in] ReportOUTData Buffer containing the report to send to the device - * \param[in] ReportIndex Index of the report in the device (zero if the device does not use multiple reports) - * \param[in] ReportType Type of report to send, either REPORT_TYPE_OUT or REPORT_TYPE_FEATURE - * \param[in] ReportLength Length of the report to send + * \param[in] ReportIndex Index of the report in the device (zero if the device does not use multiple reports) + * \param[in] ReportType Type of report to send, either REPORT_TYPE_OUT or REPORT_TYPE_FEATURE + * \param[in] ReportLength Length of the report to send */ -void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength) +void WriteNextReport(uint8_t* ReportOUTData, + const uint8_t ReportIndex, + const uint8_t ReportType, + uint16_t ReportLength) { /* Select the HID data OUT pipe */ Pipe_SelectPipe(HID_DATA_OUT_PIPE); diff --git a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h index 8d0674eee69662bcf1d117c308bcdc74168f3497..89ac01958ec2545b3c08a07d7261467b7c10e87a 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h +++ b/Demos/Host/LowLevel/GenericHIDHost/GenericHIDHost.h @@ -90,10 +90,14 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ReadNextReport(void); - void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength); + void WriteNextReport(uint8_t* ReportOUTData, + const uint8_t ReportIndex, + const uint8_t ReportType, + uint16_t ReportLength); #endif diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c index cc7c98bfcf410da651953aa80d8a796eb5700543..bda99bdd02ebe11b39af28d366fb13fdec2691b5 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.c @@ -79,7 +79,7 @@ uint8_t GetHIDReportData(void) * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { bool IsJoystick = false; diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h index 3ffc051e84910e3343bfa981d4e4ed5c752dbc6f..da73ff823a27a5b587028be45b4458fb319d0466 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/HIDReport.h @@ -89,6 +89,6 @@ /* Function Prototypes: */ uint8_t GetHIDReportData(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h index cf6369b9b96d515b6eab341653786c85f6877e8d..95a0a639e94b6e533ed72359b7b2fb67ea9af42c 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/JoystickHostWithParser.h @@ -76,7 +76,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ProcessJoystickReport(uint8_t* JoystickReport); diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c index debbf76510cc421405576e2aa323abb8369f2ca3..d98c2655753a9a2cf43081775be5441f5b6f52a3 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h index dc09f84c9f4e283a569e10a0d486531b9b56e887..91a2be534c12af7d59b67c983d6d70b54cfcd372 100644 --- a/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h +++ b/Demos/Host/LowLevel/KeyboardHost/KeyboardHost.h @@ -87,7 +87,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ReadNextReport(void); diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c index eb8ec59a836d3b98ffe146ff73ebb2647114c409..6b4df377d209e8cb7413ae4e1aa2d92d6cf53cb8 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.c @@ -79,7 +79,7 @@ uint8_t GetHIDReportData(void) * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { /* Check the attributes of the current item - see if we are interested in it or not; * only store KEYBOARD usage page items into the Processed HID Report structure to diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h index 428b91a2b156d78ad94cb9d32cb19dd5e8049cf9..09cace965c5903d8f5db84b404dfa837326b36e7 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/HIDReport.h @@ -77,6 +77,6 @@ /* Function Prototypes: */ uint8_t GetHIDReportData(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c index 301f6de3ed31025b4982563d43d7db05baaf5671..666879c9828fb0bd046e95bdb530ef8dcbd8cf2b 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h index 500b7cb2c4b876313cd6bed09145e94cc00b6b1d..76b3b49a999e968c4f3ffefac48610df1bf37cc2 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.h @@ -71,7 +71,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ProcessKeyboardReport(uint8_t* KeyboardReport); diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 9c8190286555ad718faacb1a7a5dac096fc19494..f518550b5d5481983d45ff36f77f7e9506cf3b8c 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -114,7 +114,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h index 1338f65166a4cedc76922617bb9573117983069c..ecae67c8d6bd0c7ebef4345b68919c356961d4b6 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.h +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.h @@ -108,7 +108,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c index 129c50af8343232c4f84aa758b3de8f8ffd2b0e8..b94bbcac7d69ed6ecd29bb1f612c925627dafe4f 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c @@ -63,7 +63,8 @@ static uint32_t MassStore_Tag = 1; * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum */ -static uint8_t MassStore_SendCommand(CommandBlockWrapper_t* SCSICommandBlock, void* BufferPtr) +static uint8_t MassStore_SendCommand(CommandBlockWrapper_t* const SCSICommandBlock, + void* BufferPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -178,7 +179,8 @@ static uint8_t MassStore_WaitForDataReceived(void) * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum */ -static uint8_t MassStore_SendReceiveData(CommandBlockWrapper_t* SCSICommandBlock, void* BufferPtr) +static uint8_t MassStore_SendReceiveData(CommandBlockWrapper_t* const SCSICommandBlock, + void* BufferPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; uint16_t BytesRem = SCSICommandBlock->DataTransferLength; @@ -233,7 +235,7 @@ static uint8_t MassStore_SendReceiveData(CommandBlockWrapper_t* SCSICommandBlock * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -static uint8_t MassStore_GetReturnedStatus(CommandStatusWrapper_t* SCSICommandStatus) +static uint8_t MassStore_GetReturnedStatus(CommandStatusWrapper_t* const SCSICommandStatus) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -334,7 +336,8 @@ uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex) * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_Inquiry(const uint8_t LUNIndex, SCSI_Inquiry_Response_t* const InquiryPtr) +uint8_t MassStore_Inquiry(const uint8_t LUNIndex, + SCSI_Inquiry_Response_t* const InquiryPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -384,7 +387,8 @@ uint8_t MassStore_Inquiry(const uint8_t LUNIndex, SCSI_Inquiry_Response_t* const * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_RequestSense(const uint8_t LUNIndex, SCSI_Request_Sense_Response_t* const SensePtr) +uint8_t MassStore_RequestSense(const uint8_t LUNIndex, + SCSI_Request_Sense_Response_t* const SensePtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -437,8 +441,11 @@ uint8_t MassStore_RequestSense(const uint8_t LUNIndex, SCSI_Request_Sense_Respon * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress, - const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) +uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, + const uint32_t BlockAddress, + const uint8_t Blocks, + const uint16_t BlockSize, + void* BufferPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -495,8 +502,11 @@ uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAd * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress, - const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) +uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, + const uint32_t BlockAddress, + const uint8_t Blocks, + const uint16_t BlockSize, + void* BufferPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -599,7 +609,8 @@ uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex) * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const CapacityPtr) +uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, + SCSI_Capacity_t* const CapacityPtr) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; @@ -658,7 +669,8 @@ uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const Ca * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum, or MASS_STORE_SCSI_COMMAND_FAILED if the SCSI command fails */ -uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool PreventRemoval) +uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, + const bool PreventRemoval) { uint8_t ErrorCode = PIPE_RWSTREAM_NoError; diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h index aa349946c60f267c031d31bce36c720f9dc623c8..5c1e80b5144b1cc070abd40a44699e42a70d8dd5 100644 --- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h +++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h @@ -185,25 +185,34 @@ /* Function Prototypes: */ #if defined(INCLUDE_FROM_MASSSTORE_COMMANDS_C) - static uint8_t MassStore_SendCommand(CommandBlockWrapper_t* SCSICommandBlock, void* BufferPtr); + static uint8_t MassStore_SendCommand(CommandBlockWrapper_t* const SCSICommandBlock, + void* BufferPtr); static uint8_t MassStore_WaitForDataReceived(void); - static uint8_t MassStore_SendReceiveData(CommandBlockWrapper_t* SCSICommandBlock, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(1); - static uint8_t MassStore_GetReturnedStatus(CommandStatusWrapper_t* SCSICommandStatus) ATTR_NON_NULL_PTR_ARG(1); + static uint8_t MassStore_SendReceiveData(CommandBlockWrapper_t* const SCSICommandBlock, + void* BufferPtr) ATTR_NON_NULL_PTR_ARG(1); + static uint8_t MassStore_GetReturnedStatus(CommandStatusWrapper_t* const SCSICommandStatus) ATTR_NON_NULL_PTR_ARG(1); #endif uint8_t MassStore_MassStorageReset(void); uint8_t MassStore_GetMaxLUN(uint8_t* const MaxLUNIndex); - uint8_t MassStore_RequestSense(const uint8_t LUNIndex, SCSI_Request_Sense_Response_t* const SensePtr) - ATTR_NON_NULL_PTR_ARG(2); - uint8_t MassStore_Inquiry(const uint8_t LUNIndex, SCSI_Inquiry_Response_t* const InquiryPtr) - ATTR_NON_NULL_PTR_ARG(2); - uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress, - const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5); - uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, const uint32_t BlockAddress, - const uint8_t Blocks, const uint16_t BlockSize, void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5); - uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, SCSI_Capacity_t* const CapacityPtr) - ATTR_NON_NULL_PTR_ARG(2); + uint8_t MassStore_RequestSense(const uint8_t LUNIndex, + SCSI_Request_Sense_Response_t* const SensePtr) ATTR_NON_NULL_PTR_ARG(2); + uint8_t MassStore_Inquiry(const uint8_t LUNIndex, + SCSI_Inquiry_Response_t* const InquiryPtr) ATTR_NON_NULL_PTR_ARG(2); + uint8_t MassStore_ReadDeviceBlock(const uint8_t LUNIndex, + const uint32_t BlockAddress, + const uint8_t Blocks, + const uint16_t BlockSize, + void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5); + uint8_t MassStore_WriteDeviceBlock(const uint8_t LUNIndex, + const uint32_t BlockAddress, + const uint8_t Blocks, + const uint16_t BlockSize, + void* BufferPtr) ATTR_NON_NULL_PTR_ARG(5); + uint8_t MassStore_ReadCapacity(const uint8_t LUNIndex, + SCSI_Capacity_t* const CapacityPtr) ATTR_NON_NULL_PTR_ARG(2); uint8_t MassStore_TestUnitReady(const uint8_t LUNIndex); - uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, const bool PreventRemoval); + uint8_t MassStore_PreventAllowMediumRemoval(const uint8_t LUNIndex, + const bool PreventRemoval); #endif diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c index 2739fc99aadea7ce02f3bf7d7d9b8de83cad30af..985aeeb08dece06378048cba685d7a68fef8ccbb 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c @@ -117,7 +117,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -373,7 +374,8 @@ void MassStorage_Task(void) * \param[in] CommandString ASCII string located in PROGMEM space indicating what operation failed * \param[in] ErrorCode Error code of the function which failed to complete successfully */ -void ShowDiskReadError(char* CommandString, uint8_t ErrorCode) +void ShowDiskReadError(char* CommandString, + const uint8_t ErrorCode) { if (ErrorCode == MASS_STORE_SCSI_COMMAND_FAILED) { diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h index 14d8d9734e677155c1285e6bf729bb48732ae362..7aabe9f7dbcbe4e204972feeac08f752f52d6972 100644 --- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h +++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h @@ -80,9 +80,11 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - void ShowDiskReadError(char* CommandString, uint8_t ErrorCode); + void ShowDiskReadError(char* CommandString, + const uint8_t ErrorCode); #endif diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.c b/Demos/Host/LowLevel/MouseHost/MouseHost.c index 6e7b284dffec381cb61bfc7447d70154bb0899a5..bf20bca52e56e1b2b08926141957e6ac378e524b 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.c +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/MouseHost/MouseHost.h b/Demos/Host/LowLevel/MouseHost/MouseHost.h index f196dadcbf8e4a4e7235d1371fc0118ea7a7bc09..b9c5aeda1023bc70fb85dc0847ecc323361ae469 100644 --- a/Demos/Host/LowLevel/MouseHost/MouseHost.h +++ b/Demos/Host/LowLevel/MouseHost/MouseHost.h @@ -87,7 +87,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ReadNextReport(void); diff --git a/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.c b/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.c index f551f2f4cf97aec518a225438b983092395fb00a..327ae45ecb6e8cf76d8cef4459f4ae55aa60116d 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.c @@ -79,7 +79,7 @@ uint8_t GetHIDReportData(void) * * \return Boolean true if the item should be stored into the HID report structure, false if it should be discarded */ -bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem) +bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem) { bool IsMouse = false; diff --git a/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.h b/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.h index 684c74319e900789fa7dd8347d85454c8d3d32a7..bd12a39c177ba256e30e7121cac45cb5f019cb27 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/HIDReport.h @@ -92,6 +92,6 @@ /* Function Prototypes: */ uint8_t GetHIDReportData(void); - bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem); + bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem); #endif diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c index efe1421a281cef19d90e50cb51b61c1ea075da25..1b9c12aa9de0f53044bb35edd674dc5eb1aae8a7 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h index 2c11f110ce0308832654240831a1de60abc499ee..3a80c8e60cc4f8364b66038d1ee21dc4d466cf5f 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h @@ -76,7 +76,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void ProcessMouseReport(uint8_t* MouseReport); diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c index 5f3effa7bf088e1035c1fe1597c5eded67542514..024895991eaa7c752fc2b6b175ec969a4594118a 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.c @@ -44,7 +44,8 @@ * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum */ -uint8_t Printer_SendData(const void* const PrinterCommands, const uint16_t CommandSize) +uint8_t Printer_SendData(const void* const PrinterCommands, + const uint16_t CommandSize) { uint8_t ErrorCode; @@ -74,7 +75,8 @@ uint8_t Printer_SendData(const void* const PrinterCommands, const uint16_t Comma * * \return A value from the USB_Host_SendControlErrorCodes_t enum */ -uint8_t Printer_GetDeviceID(char* DeviceIDString, const uint16_t BufferSize) +uint8_t Printer_GetDeviceID(char* DeviceIDString, + const uint16_t BufferSize) { uint8_t ErrorCode = HOST_SENDCONTROL_Successful; uint16_t DeviceIDStringLength = 0; diff --git a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h index cbc54564c3b5e0d19c784e15368bb86b6c96018b..8c3bd33168438b5837bcf344ccc61eecc3fbd3a1 100644 --- a/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h +++ b/Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h @@ -59,9 +59,11 @@ #define PRINTER_DATA_OUT_PIPE 2 /* Function Prototypes: */ - uint8_t Printer_SendData(const void* const PrinterCommands, const uint16_t CommandSize); - uint8_t Printer_GetDeviceID(char* DeviceIDString, const uint16_t BufferSize); - uint8_t Printer_GetPortStatus(uint8_t* PortStatus); + uint8_t Printer_SendData(const void* const PrinterCommands, + const uint16_t CommandSize); + uint8_t Printer_GetDeviceID(char* DeviceIDString, + const uint16_t BufferSize); + uint8_t Printer_GetPortStatus(uint8_t* const PortStatus); uint8_t Printer_SoftReset(void); #endif diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c index b6f3efae32a48cb457cef3456e3d19915547e72a..f12c95ef94a2ab71b093ed4109b3f9b8fcac9597 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.c +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.c @@ -98,7 +98,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) } /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */ -void EVENT_USB_Host_HostError(uint8_t ErrorCode) +void EVENT_USB_Host_HostError(const uint8_t ErrorCode) { USB_ShutDown(); @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h index 99bbd4a6677d03dc7696b3b571e03b5da8ad610c..78583f0e45b9217b846ef7adaefbe0bd928c1394 100644 --- a/Demos/Host/LowLevel/PrinterHost/PrinterHost.h +++ b/Demos/Host/LowLevel/PrinterHost/PrinterHost.h @@ -74,8 +74,9 @@ void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); void EVENT_USB_Host_DeviceEnumerationComplete(void); - void EVENT_USB_Host_HostError(uint8_t ErrorCode); - void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode); + void EVENT_USB_Host_HostError(const uint8_t ErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void SetupHardware(void); diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.c b/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.c index 5200372e96de258be7804c1ffd010c97409a09ca..cd142ef55372d305e1932fb5dc53ed9acd68210e 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.c @@ -47,7 +47,8 @@ uint32_t RequestID = 0; * * \return A value from the USB_Host_SendControlErrorCodes_t enum */ -uint8_t RNDIS_SendEncapsulatedCommand(void* const Buffer, const uint16_t Length) +uint8_t RNDIS_SendEncapsulatedCommand(void* const Buffer, + const uint16_t Length) { USB_ControlRequest = (USB_Request_Header_t) { @@ -71,7 +72,8 @@ uint8_t RNDIS_SendEncapsulatedCommand(void* const Buffer, const uint16_t Length) * * \return A value from the USB_Host_SendControlErrorCodes_t enum */ -uint8_t RNDIS_GetEncapsulatedResponse(void* const Buffer, const uint16_t Length) +uint8_t RNDIS_GetEncapsulatedResponse(void* const Buffer, + const uint16_t Length) { USB_ControlRequest = (USB_Request_Header_t) { @@ -128,7 +130,8 @@ uint8_t RNDIS_SendKeepAlive(void) * \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a * logical command failure */ -uint8_t RNDIS_InitializeDevice(const uint16_t HostMaxPacketSize, uint16_t* const DeviceMaxPacketSize) +uint8_t RNDIS_InitializeDevice(const uint16_t HostMaxPacketSize, + uint16_t* const DeviceMaxPacketSize) { uint8_t ErrorCode; @@ -172,7 +175,9 @@ uint8_t RNDIS_InitializeDevice(const uint16_t HostMaxPacketSize, uint16_t* const * \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a * logical command failure */ -uint8_t RNDIS_SetRNDISProperty(const uint32_t Oid, void* Buffer, const uint16_t Length) +uint8_t RNDIS_SetRNDISProperty(const uint32_t Oid, + void* Buffer, + const uint16_t Length) { uint8_t ErrorCode; @@ -222,7 +227,9 @@ uint8_t RNDIS_SetRNDISProperty(const uint32_t Oid, void* Buffer, const uint16_t * \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a * logical command failure */ -uint8_t RNDIS_QueryRNDISProperty(const uint32_t Oid, void* Buffer, const uint16_t MaxLength) +uint8_t RNDIS_QueryRNDISProperty(const uint32_t Oid, + void* Buffer, + const uint16_t MaxLength) { uint8_t ErrorCode; diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.h b/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.h index a2f15c5a7f359c34265c48f293e2169688fbc6c1..960d5382331460deb4761a057f4697a0bbc7cf08 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.h @@ -200,13 +200,20 @@ #define RNDIS_COMMAND_FAILED 0xC0 /* Function Prototypes: */ - uint8_t RNDIS_SendEncapsulatedCommand(void* const Buffer, const uint16_t Length); - uint8_t RNDIS_GetEncapsulatedResponse(void* const Buffer, const uint16_t Length); + uint8_t RNDIS_SendEncapsulatedCommand(void* const Buffer, + const uint16_t Length); + uint8_t RNDIS_GetEncapsulatedResponse(void* const Buffer, + const uint16_t Length); uint8_t RNDIS_SendKeepAlive(void); - uint8_t RNDIS_InitializeDevice(const uint16_t HostMaxPacketSize, uint16_t* const DeviceMaxPacketSize); - uint8_t RNDIS_SetRNDISProperty(const uint32_t Oid, void* Buffer, const uint16_t Length); - uint8_t RNDIS_QueryRNDISProperty(const uint32_t Oid, void* Buffer, const uint16_t MaxLength); + uint8_t RNDIS_InitializeDevice(const uint16_t HostMaxPacketSize, + uint16_t* const DeviceMaxPacketSize); + uint8_t RNDIS_SetRNDISProperty(const uint32_t Oid, + void* Buffer, + const uint16_t Length); + uint8_t RNDIS_QueryRNDISProperty(const uint32_t Oid, + void* Buffer, + const uint16_t MaxLength); uint8_t RNDIS_GetPacketLength(uint16_t* const PacketLength); #endif diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c index 1d18f11e6489184710e2a96918c625c23f68951a..1da5b4dbf707a3e541cf51619a2d0806f842264d 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h index 46b47f95c47d251c3df381edcd9cf691098edaae..08187f9fa4545ed915eaf4752b2641e36ebb0e75 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/RNDISEthernetHost.h @@ -91,7 +91,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c index 53045098857f131e4b17e0998c0d210c83c62415..a99a95680b61909b68a46cac818c84d233650fd6 100644 --- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c +++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c @@ -198,7 +198,8 @@ uint8_t SImage_ReceiveBlockHeader(void) * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum */ -uint8_t SImage_SendData(void* const Buffer, const uint16_t Bytes) +uint8_t SImage_SendData(void* const Buffer, + const uint16_t Bytes) { uint8_t ErrorCode; @@ -225,7 +226,8 @@ uint8_t SImage_SendData(void* const Buffer, const uint16_t Bytes) * * \return A value from the Pipe_Stream_RW_ErrorCodes_t enum */ -uint8_t SImage_ReadData(void* const Buffer, const uint16_t Bytes) +uint8_t SImage_ReadData(void* const Buffer, + const uint16_t Bytes) { uint8_t ErrorCode; diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h index a57ddaf2c5493996ee83770476b06c2fb07a83a1..c91a8012234abb8c95262e95dfdc8f7078e830c0 100644 --- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h +++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h @@ -108,8 +108,10 @@ void SImage_SendBlockHeader(void); uint8_t SImage_ReceiveBlockHeader(void); uint8_t SImage_ReceiveEventHeader(void); - uint8_t SImage_SendData(void* const Buffer, const uint16_t Bytes); - uint8_t SImage_ReadData(void* const Buffer, const uint16_t Bytes); + uint8_t SImage_SendData(void* const Buffer, + const uint16_t Bytes); + uint8_t SImage_ReadData(void* const Buffer, + const uint16_t Bytes); bool SImage_IsEventReceived(void); #endif diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c index 686eb5ff45003391041cef234969eed964afe87e..73f0c2c7655ffe8c1cdd1467c30fe0e14e9268df 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.c +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.c @@ -113,7 +113,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" @@ -339,7 +340,8 @@ void StillImage_Task(void) * \param[in] UnicodeString Pointer to a Unicode encoded input string * \param[out] Buffer Pointer to a buffer where the converted ASCII string should be stored */ -void UnicodeToASCII(uint8_t* UnicodeString, char* Buffer) +void UnicodeToASCII(uint8_t* UnicodeString, + char* Buffer) { /* Get the number of characters in the string, skip to the start of the string data */ uint8_t CharactersRemaining = *(UnicodeString++); @@ -363,7 +365,8 @@ void UnicodeToASCII(uint8_t* UnicodeString, char* Buffer) * \param[in] ErrorCode Error code of the function which failed to complete successfully * \param[in] ResponseCodeError Indicates if the error is due to a command failed indication from the device, or a communication failure */ -void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError) +void ShowCommandError(uint8_t ErrorCode, + bool ResponseCodeError) { char* FailureType = ((ResponseCodeError) ? PSTR("Response Code != OK") : PSTR("Transaction Fail")); diff --git a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h index d7b893ee25755f20e3218a858f7cc1a6c358e38b..61e5eb5b535eef3789216bef73173e3c68515652 100644 --- a/Demos/Host/LowLevel/StillImageHost/StillImageHost.h +++ b/Demos/Host/LowLevel/StillImageHost/StillImageHost.h @@ -76,10 +76,13 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); - void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer); - void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError); + void UnicodeToASCII(uint8_t* UnicodeString, + char* Buffer); + void ShowCommandError(uint8_t ErrorCode, + bool ResponseCodeError); #endif diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c index 8bec8e562771776173b5bb8ccc3f2b527a8788c9..4c250cd482194e84880d7919ba78e1bf2b57d589 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.c @@ -112,7 +112,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" diff --git a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h index 4227b5383dbe9c510a5644e4fcf2b723001f0534..cf785e32030b48a4f9f9188fb5f96cfeb2aa37f9 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/VirtualSerialHost.h @@ -81,7 +81,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Projects/AVRISP-MKII/Descriptors.c b/Projects/AVRISP-MKII/Descriptors.c index 95a41f18a5e4b041d23ab93932b7540781c8f16a..243c570203c43b8d0b8068af2a93669af2437e98 100644 --- a/Projects/AVRISP-MKII/Descriptors.c +++ b/Projects/AVRISP-MKII/Descriptors.c @@ -172,7 +172,9 @@ USB_Descriptor_String_t PROGMEM SerialString = * 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); diff --git a/Projects/AVRISP-MKII/Descriptors.h b/Projects/AVRISP-MKII/Descriptors.h index f946899760c8418f5ad8e5a25d55443e2cc9f162..f991aa02267de5625b19658153a5d6ff6d3bfb7b 100644 --- a/Projects/AVRISP-MKII/Descriptors.h +++ b/Projects/AVRISP-MKII/Descriptors.h @@ -73,7 +73,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 diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c index 430c9158a95277f3bdd316272b2c237cff49080c..2df8710eb43d6d22e95fe0e8607df1b795e5b495 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.c @@ -109,8 +109,11 @@ void ISPTarget_ChangeTargetResetLine(const bool ResetTarget) * \return V2 Protocol status \ref STATUS_CMD_OK if the no timeout occurred, \ref STATUS_RDY_BSY_TOUT or * \ref STATUS_CMD_TOUT otherwise */ -uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint16_t PollAddress, const uint8_t PollValue, - const uint8_t DelayMS, const uint8_t ReadMemCommand) +uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, + const uint16_t PollAddress, + const uint8_t PollValue, + const uint8_t DelayMS, + const uint8_t ReadMemCommand) { uint8_t ProgrammingStatus = STATUS_CMD_OK; diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h index 34d623ed709ca81225329f6bc2bb308b57f04e10..869e0e58b415884665902e1725b6daf35db444bc 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h @@ -65,8 +65,10 @@ /* Function Prototypes: */ uint8_t ISPTarget_GetSPIPrescalerMask(void); void ISPTarget_ChangeTargetResetLine(const bool ResetTarget); - uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, const uint16_t PollAddress, - const uint8_t PollValue, const uint8_t DelayMS, + uint8_t ISPTarget_WaitForProgComplete(const uint8_t ProgrammingMode, + const uint16_t PollAddress, + const uint8_t PollValue, + const uint8_t DelayMS, const uint8_t ReadMemCommand); uint8_t ISPTarget_WaitWhileTargetBusy(void); void ISPTarget_LoadExtendedAddress(void); diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c index bc3ed18e09f7ee369dbd9850ece74dbd918939f8..56b18f60ac3f5338adeb83ba0a2a2ad1c6130c8b 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.c @@ -151,7 +151,8 @@ uint8_t V2Params_GetParameterValue(const uint8_t ParamID) * * \return Pointer to the associated parameter information from the parameter table if found, NULL otherwise */ -void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value) +void V2Params_SetParameterValue(const uint8_t ParamID, + const uint8_t Value) { ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID); diff --git a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h index d93aaddbf809fcd47969862e570df9927af6f7ae..4b7e189133e3b1d06939f0741ec7de182de1bd31 100644 --- a/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h +++ b/Projects/AVRISP-MKII/Lib/V2ProtocolParams.h @@ -75,7 +75,8 @@ uint8_t V2Params_GetParameterPrivileges(const uint8_t ParamID); uint8_t V2Params_GetParameterValue(const uint8_t ParamID); - void V2Params_SetParameterValue(const uint8_t ParamID, const uint8_t Value); + void V2Params_SetParameterValue(const uint8_t ParamID, + const uint8_t Value); #if defined(INCLUDE_FROM_V2PROTOCOL_PARAMS_C) static ParameterItem_t* V2Params_GetParamFromTable(const uint8_t ParamID); diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c index 150f64244d4f44803cefdca90c68c481419effb6..d45e42a1a98fb95d4e1127f351c33e135faadbed 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c @@ -127,7 +127,9 @@ bool TINYNVM_WaitWhileNVMControllerBusy(void) * * \return Boolean true if the command sequence complete successfully */ -bool TINYNVM_ReadMemory(const uint16_t ReadAddress, uint8_t* ReadBuffer, uint16_t ReadSize) +bool TINYNVM_ReadMemory(const uint16_t ReadAddress, + uint8_t* ReadBuffer, + uint16_t ReadSize) { /* Wait until the NVM controller is no longer busy */ if (!(TINYNVM_WaitWhileNVMControllerBusy())) @@ -158,7 +160,9 @@ bool TINYNVM_ReadMemory(const uint16_t ReadAddress, uint8_t* ReadBuffer, uint16_ * * \return Boolean true if the command sequence complete successfully */ -bool TINYNVM_WriteMemory(const uint16_t WriteAddress, uint8_t* WriteBuffer, uint16_t WriteLength) +bool TINYNVM_WriteMemory(const uint16_t WriteAddress, + uint8_t* WriteBuffer, + uint16_t WriteLength) { /* Wait until the NVM controller is no longer busy */ if (!(TINYNVM_WaitWhileNVMControllerBusy())) @@ -203,7 +207,8 @@ bool TINYNVM_WriteMemory(const uint16_t WriteAddress, uint8_t* WriteBuffer, uint * * \return Boolean true if the command sequence complete successfully */ -bool TINYNVM_EraseMemory(const uint8_t EraseCommand, const uint16_t Address) +bool TINYNVM_EraseMemory(const uint8_t EraseCommand, + const uint16_t Address) { /* Wait until the NVM controller is no longer busy */ if (!(TINYNVM_WaitWhileNVMControllerBusy())) diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h index 2daca16fcf056d4312b2a0a32da039c3610dd512..cbb2c27aac32bec02be175c69d8b65f714560ff5 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h +++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.h @@ -64,9 +64,14 @@ /* Function Prototypes: */ bool TINYNVM_WaitWhileNVMBusBusy(void); bool TINYNVM_WaitWhileNVMControllerBusy(void); - bool TINYNVM_ReadMemory(const uint16_t ReadAddress, uint8_t* ReadBuffer, uint16_t ReadLength); - bool TINYNVM_WriteMemory(const uint16_t WriteAddress, uint8_t* WriteBuffer, uint16_t WriteLength); - bool TINYNVM_EraseMemory(const uint8_t EraseCommand, const uint16_t Address); + bool TINYNVM_ReadMemory(const uint16_t ReadAddress, + uint8_t* ReadBuffer, + uint16_t ReadLength); + bool TINYNVM_WriteMemory(const uint16_t WriteAddress, + uint8_t* WriteBuffer, + uint16_t WriteLength); + bool TINYNVM_EraseMemory(const uint8_t EraseCommand, + const uint16_t Address); #if (defined(INCLUDE_FROM_TINYNVM_C) && defined(ENABLE_XPROG_PROTOCOL)) static void TINYNVM_SendReadNVMRegister(const uint8_t Address); diff --git a/Projects/Benito/Descriptors.c b/Projects/Benito/Descriptors.c index 3ca9dd9f45b80e5aed466fcaa8c6eb269c6c7547..6a9e791bbf09a6b1a8cd236c900497a2e339378e 100644 --- a/Projects/Benito/Descriptors.c +++ b/Projects/Benito/Descriptors.c @@ -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); diff --git a/Projects/Benito/Descriptors.h b/Projects/Benito/Descriptors.h index 07a361385fd8e0d82346f383972bbcbefc94f7b8..8012ebdde99707c48dd44d4d560e24d5570e2716 100644 --- a/Projects/Benito/Descriptors.h +++ b/Projects/Benito/Descriptors.h @@ -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 diff --git a/Projects/Benito/Lib/LightweightRingBuff.h b/Projects/Benito/Lib/LightweightRingBuff.h index 0ffe792dcc39c5b5493688353ff6854e9a6a4c07..1d6e07fded9085b4f289f429be402c5be2b9ab70 100644 --- a/Projects/Benito/Lib/LightweightRingBuff.h +++ b/Projects/Benito/Lib/LightweightRingBuff.h @@ -100,7 +100,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { @@ -141,7 +142,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_Insert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_Insert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { *Buffer->In = Data; diff --git a/Projects/Incomplete/MIDIToneGenerator/Descriptors.c b/Projects/Incomplete/MIDIToneGenerator/Descriptors.c index 640c83224407784f524d1cdb135367eed8ebec3e..9ce300afc5fb44256814a3ae5e23722b1232d083 100644 --- a/Projects/Incomplete/MIDIToneGenerator/Descriptors.c +++ b/Projects/Incomplete/MIDIToneGenerator/Descriptors.c @@ -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); diff --git a/Projects/Incomplete/MIDIToneGenerator/Descriptors.h b/Projects/Incomplete/MIDIToneGenerator/Descriptors.h index 9933d060e5818a9eb616850b9133312262ae4ea1..fc648de4b2636f037030043430e346d30cd66c2d 100644 --- a/Projects/Incomplete/MIDIToneGenerator/Descriptors.h +++ b/Projects/Incomplete/MIDIToneGenerator/Descriptors.h @@ -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 diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c index d6ffde80455663e884f36b3a71b4643ac8429e78..cd2b0d3b894dbeb8b80fdebfaabd2930447f1533 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.c +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.c @@ -176,7 +176,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); diff --git a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h index 440259341e8da5db871580abf2b37a38b9bd1274..d78bbba20710244f33a55d0dd3ee1c2166fe4a61 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Descriptors.h +++ b/Projects/Incomplete/StandaloneProgrammer/Descriptors.h @@ -82,7 +82,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 diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.c b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.c index f54b25be45bc94949b02f61d7551e8c7001322c2..b274a10835926e8962f5e854a8a4bfab2fac4af3 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.c +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.c @@ -48,7 +48,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); @@ -182,7 +184,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); @@ -290,7 +294,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, const uint8_t* BufferPtr) +void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, + uint16_t TotalBlocks, + const 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); @@ -389,7 +395,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); diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h index 8f62219ca7f5c123310ede87b1579b25d2fcb3f7..406ae62afe85f60e69447d163c866be3b282321f 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h @@ -67,13 +67,17 @@ /* Function Prototypes: */ #if defined(USB_CAN_BE_DEVICE) - 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, const 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); diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c index 74f6811ad5871019a27f4fcb0393f7c7624eec50..0bf6abdf71b815d63395ae6688c9d6e6b1fa53a4 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c @@ -248,7 +248,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]); diff --git a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h index 3927a4fda39fad8371d72b9489129581d9c8d00a..22c3a1d44973bf7eb0914aaff33a0faeb75ff41b 100644 --- a/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h +++ b/Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h @@ -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 diff --git a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h index dff45fcb2b04ce5b29784d826842a361c90d8e04..dfb8a9f3a659b8647a7c4bed3752e6ecb79d049c 100644 --- a/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h +++ b/Projects/Incomplete/StandaloneProgrammer/StandaloneProgrammer.h @@ -72,7 +72,7 @@ #define LEDMASK_USB_BUSY LEDS_LED2 /* External Variables: */ - extern FILE DiskStream; + extern FILE DiskStream; extern FATFS DiskFATState; /* Function Prototypes: */ diff --git a/Projects/LEDNotifier/Board/LEDs.h b/Projects/LEDNotifier/Board/LEDs.h index decd2b0549436705e13ab9000522313bf18436b1..c43cfc8bcc115d2d494ca271262a56deb6ca9673 100644 --- a/Projects/LEDNotifier/Board/LEDs.h +++ b/Projects/LEDNotifier/Board/LEDs.h @@ -87,7 +87,8 @@ PORTC = (PORTC & ~LEDS_ALL_LEDS) | LEDMask; } - static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) + static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, + const uint8_t ActiveMask) { PORTC = (PORTC & ~LEDMask) | ActiveMask; } diff --git a/Projects/LEDNotifier/Descriptors.c b/Projects/LEDNotifier/Descriptors.c index 67d0deb8b79abbdb4d869bf5d2ee3c401ffffb03..316ad45eb740aef94b955396c979786ac414fc17 100644 --- a/Projects/LEDNotifier/Descriptors.c +++ b/Projects/LEDNotifier/Descriptors.c @@ -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); diff --git a/Projects/LEDNotifier/Descriptors.h b/Projects/LEDNotifier/Descriptors.h index 017e3fe1ef5cefa5c616a9714168ad85a4de702b..387034f11d04c4349a423f81416ccf582f473fc6 100644 --- a/Projects/LEDNotifier/Descriptors.h +++ b/Projects/LEDNotifier/Descriptors.h @@ -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 diff --git a/Projects/Magstripe/Descriptors.c b/Projects/Magstripe/Descriptors.c index c544ba6357dbec687c0b1511d724946fd11adb96..219ead1e71a1d07278e5f95f1bb5f7b52e1f0ccf 100644 --- a/Projects/Magstripe/Descriptors.c +++ b/Projects/Magstripe/Descriptors.c @@ -196,7 +196,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); diff --git a/Projects/Magstripe/Descriptors.h b/Projects/Magstripe/Descriptors.h index 02a14b40071199b2c158181204b5b44c63e5e2ae..85d073780605b98c2aa38e6d69a4af600c0ca540 100644 --- a/Projects/Magstripe/Descriptors.h +++ b/Projects/Magstripe/Descriptors.h @@ -64,7 +64,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 diff --git a/Projects/Magstripe/Lib/CircularBitBuffer.c b/Projects/Magstripe/Lib/CircularBitBuffer.c index 8be527b4dbcb955cf4527786213346dfc33c1bb4..c1b21039c61c962984ca2e454973794a36f6a34a 100644 --- a/Projects/Magstripe/Lib/CircularBitBuffer.c +++ b/Projects/Magstripe/Lib/CircularBitBuffer.c @@ -50,7 +50,8 @@ void BitBuffer_Init(BitBuffer_t* const Buffer) } /** Function to store the given bit into the given bit buffer. */ -void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, const bool Bit) +void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, + const bool Bit) { /* If the bit to store is true, set the next bit in the buffer */ if (Bit) diff --git a/Projects/Magstripe/Lib/CircularBitBuffer.h b/Projects/Magstripe/Lib/CircularBitBuffer.h index dff4d2e5d99a304e8d7630c996ad02abc6ce15e9..973c7c26cc6afacf5babcc47653467da91aa6813 100644 --- a/Projects/Magstripe/Lib/CircularBitBuffer.h +++ b/Projects/Magstripe/Lib/CircularBitBuffer.h @@ -82,7 +82,8 @@ * \param[in,out] Buffer Bit buffer to store a bit into * \param[in] Bit Bit to store into the buffer */ - void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, const bool Bit) ATTR_NON_NULL_PTR_ARG(1); + void BitBuffer_StoreNextBit(BitBuffer_t* const Buffer, + const bool Bit) ATTR_NON_NULL_PTR_ARG(1); /** Retrieves a bit from the next location inside a given bit buffer. * diff --git a/Projects/Magstripe/Magstripe.c b/Projects/Magstripe/Magstripe.c index e404eaf0e19f770b33ca74539233f2076ebc468b..4c0d7a191ae54d591dc7c6e91982c7c6d5ee8c67 100644 --- a/Projects/Magstripe/Magstripe.c +++ b/Projects/Magstripe/Magstripe.c @@ -171,8 +171,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; @@ -210,8 +213,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn * \param[in] ReportData Pointer to the report buffer where the received report is stored * \param[in] ReportSize Size in bytes of the report received from the host */ -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 } diff --git a/Projects/Magstripe/Magstripe.h b/Projects/Magstripe/Magstripe.h index 4922b7be683fbe224b56cba24cc53d3911d51bad..946ef2ebfb22e7da2575f9d660eb075dcd4980b1 100644 --- a/Projects/Magstripe/Magstripe.h +++ b/Projects/Magstripe/Magstripe.h @@ -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 diff --git a/Projects/MissileLauncher/MissileLauncher.c b/Projects/MissileLauncher/MissileLauncher.c index dcc6e732f6ff6fbdd4cc3a7354b034cf83dfa776..c76dc52f4a5d669219fec2de4a8e65e2df6bd14e 100644 --- a/Projects/MissileLauncher/MissileLauncher.c +++ b/Projects/MissileLauncher/MissileLauncher.c @@ -151,7 +151,8 @@ void Read_Joystick_Status(void) * \param[in] Report Report data to send. * \param[in] ReportSize Report length in bytes. */ -void Send_Command_Report(uint8_t* const Report, const uint16_t ReportSize) +void Send_Command_Report(uint8_t* const Report, + const uint16_t ReportSize) { memcpy(CmdBuffer, Report, 8); WriteNextReport(CmdBuffer, ReportSize); @@ -212,7 +213,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) /** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while * enumerating an attached USB device. */ -void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) +void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode) { LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } @@ -245,7 +247,8 @@ void DiscardNextReport(void) * \param[in] ReportOUTData Buffer containing the report to send to the device * \param[in] ReportLength Length of the report to send */ -void WriteNextReport(uint8_t* const ReportOUTData, const uint16_t ReportLength) +void WriteNextReport(uint8_t* const ReportOUTData, + const uint16_t ReportLength) { /* Select and unfreeze HID data OUT pipe */ Pipe_SelectPipe(HID_DATA_OUT_PIPE); diff --git a/Projects/MissileLauncher/MissileLauncher.h b/Projects/MissileLauncher/MissileLauncher.h index aba261611dbbd06d78b9edba0fb2a3a360b50828..57aae09922b048b4bc45f8ff156b20391bd53990 100644 --- a/Projects/MissileLauncher/MissileLauncher.h +++ b/Projects/MissileLauncher/MissileLauncher.h @@ -82,7 +82,8 @@ void SetupHardware(void); void Read_Joystick_Status(void); - void Send_Command_Report(uint8_t* const Report, const uint16_t ReportSize); + void Send_Command_Report(uint8_t* const Report, + const uint16_t ReportSize); void Send_Command(uint8_t* const Command); void HID_Host_Task(void); @@ -90,10 +91,12 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); void DiscardNextReport(void); - void WriteNextReport(uint8_t* const ReportOUTData, const uint16_t ReportLength); + void WriteNextReport(uint8_t* const ReportOUTData, + const uint16_t ReportLength); #endif diff --git a/Projects/RelayBoard/Descriptors.c b/Projects/RelayBoard/Descriptors.c index ca353d51ffc88c8b4e76b2771cc3989743d96643..e792aec7eb4920ae8ae6759ae09172f706207faf 100644 --- a/Projects/RelayBoard/Descriptors.c +++ b/Projects/RelayBoard/Descriptors.c @@ -153,7 +153,9 @@ USB_Descriptor_String_t PROGMEM RelayBoard_SerialString = * 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); diff --git a/Projects/RelayBoard/Descriptors.h b/Projects/RelayBoard/Descriptors.h index 7b217fbcf1f25cb8cfeb17c4b3ca26e2ca07a571..f6357f82127ddf4e5614b8c3ac60ad5366cac719 100644 --- a/Projects/RelayBoard/Descriptors.h +++ b/Projects/RelayBoard/Descriptors.h @@ -54,6 +54,8 @@ } RelayBoard_USB_Descriptor_Configuration_t; /* 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); #endif diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c index 00a4d70fe2608bda28016209871186d731bb35a3..564d5ee83cf1118f28ad24efbb6e1656e78f76b5 100644 --- a/Projects/TempDataLogger/Descriptors.c +++ b/Projects/TempDataLogger/Descriptors.c @@ -237,7 +237,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); diff --git a/Projects/TempDataLogger/Descriptors.h b/Projects/TempDataLogger/Descriptors.h index a2ab5852e4eaf50d1ab147203e1593d842252a14..ff0d25cff648016f6cb0b3f57695f33d49c22126 100644 --- a/Projects/TempDataLogger/Descriptors.h +++ b/Projects/TempDataLogger/Descriptors.h @@ -54,7 +54,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 diff --git a/Projects/TempDataLogger/Lib/DS1307.c b/Projects/TempDataLogger/Lib/DS1307.c index 003160fe2bc4d3b2282bb2d8d4e04f7ec5e21b12..a85aa6176dff66e21fd3bb367bf957a92853bfbb 100644 --- a/Projects/TempDataLogger/Lib/DS1307.c +++ b/Projects/TempDataLogger/Lib/DS1307.c @@ -7,7 +7,9 @@ #include "DS1307.h" -void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year) +void DS1307_SetDate(const uint8_t Day, + const uint8_t Month, + const uint8_t Year) { #if defined(DUMMY_RTC) return; @@ -32,7 +34,9 @@ void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year) } } -void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second) +void DS1307_SetTime(const uint8_t Hour, + const uint8_t Minute, + const uint8_t Second) { #if defined(DUMMY_RTC) return; @@ -59,7 +63,9 @@ void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second) } } -void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year) +void DS1307_GetDate(uint8_t* const Day, + uint8_t* const Month, + uint8_t* const Year) { #if defined(DUMMY_RTC) *Day = 1; @@ -91,7 +97,9 @@ void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year) *Year = (CurrentRTCDate.Byte3.Fields.TenYear * 10) + CurrentRTCDate.Byte3.Fields.Year; } -void DS1307_GetTime(uint8_t* Hour, uint8_t* Minute, uint8_t* Second) +void DS1307_GetTime(uint8_t* const Hour, + uint8_t* const Minute, + uint8_t* const Second) { #if defined(DUMMY_RTC) *Hour = 1; diff --git a/Projects/TempDataLogger/Lib/DS1307.h b/Projects/TempDataLogger/Lib/DS1307.h index 58eac8e5c9b02c32e4d1ae4e0be4a1a4c91c7f55..d07bff4396dfce308e9af492fa492b732c0d2102 100644 --- a/Projects/TempDataLogger/Lib/DS1307.h +++ b/Projects/TempDataLogger/Lib/DS1307.h @@ -100,10 +100,17 @@ #define DS1307_ADDRESS_WRITE 0b11010000 /* Function Prototypes: */ - void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year); - void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second); - - void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year); - void DS1307_GetTime(uint8_t* Hour, uint8_t* Minute, uint8_t* Second); + void DS1307_SetDate(const uint8_t Day, + const uint8_t Month, + const uint8_t Year); + void DS1307_SetTime(const uint8_t Hour, + const uint8_t Minute, + const uint8_t Second); + void DS1307_GetDate(uint8_t* const Day, + uint8_t* const Month, + uint8_t* const Year); + void DS1307_GetTime(uint8_t* const Hour, + uint8_t* const Minute, + uint8_t* const Second); #endif diff --git a/Projects/TempDataLogger/Lib/DataflashManager.c b/Projects/TempDataLogger/Lib/DataflashManager.c index 48c4fa7e6ae8d9e3a4ba4344256c22e72d0cc924..1750e15b3eb3ed06855faf8f5706c073d7b733d9 100644 --- a/Projects/TempDataLogger/Lib/DataflashManager.c +++ b/Projects/TempDataLogger/Lib/DataflashManager.c @@ -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, const uint8_t* BufferPtr) +void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, + uint16_t TotalBlocks, + const 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); diff --git a/Projects/TempDataLogger/Lib/DataflashManager.h b/Projects/TempDataLogger/Lib/DataflashManager.h index 3c75c4c75725397bcf6593e57f030b9c2155ba4c..70dd88d21e95dd5bc9404614cff08200564f2394 100644 --- a/Projects/TempDataLogger/Lib/DataflashManager.h +++ b/Projects/TempDataLogger/Lib/DataflashManager.h @@ -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, const 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); diff --git a/Projects/TempDataLogger/Lib/SCSI.c b/Projects/TempDataLogger/Lib/SCSI.c index fb841e34bc3e0ce26b227566e32ad19c8c2865dd..390441aa117545c61056728b763a7c8fbaf1e216 100644 --- a/Projects/TempDataLogger/Lib/SCSI.c +++ b/Projects/TempDataLogger/Lib/SCSI.c @@ -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]); diff --git a/Projects/TempDataLogger/Lib/SCSI.h b/Projects/TempDataLogger/Lib/SCSI.h index fd739182ebca649a18a59002600ccd2f49c80343..c5504b7133c77b6c06e081bb112e5194c26423e0 100644 --- a/Projects/TempDataLogger/Lib/SCSI.h +++ b/Projects/TempDataLogger/Lib/SCSI.h @@ -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 diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c index e7c7c763e7bf62b621bd1e762b0269751fa74cbd..dd707bc085b3348f026edc77b7b2dfcd375f655e 100644 --- a/Projects/TempDataLogger/TempDataLogger.c +++ b/Projects/TempDataLogger/TempDataLogger.c @@ -279,8 +279,11 @@ bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSI * * \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) { Device_Report_t* ReportParams = (Device_Report_t*)ReportData; @@ -301,8 +304,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) { Device_Report_t* ReportParams = (Device_Report_t*)ReportData; diff --git a/Projects/TempDataLogger/TempDataLogger.h b/Projects/TempDataLogger/TempDataLogger.h index 48a051f0a17589423110cc0d1dbf0f68943343d4..45cb3bec1ba0e802e5316dae7ad818785f99615e 100644 --- a/Projects/TempDataLogger/TempDataLogger.h +++ b/Projects/TempDataLogger/TempDataLogger.h @@ -105,9 +105,15 @@ void EVENT_USB_Device_UnhandledControlRequest(void); 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 diff --git a/Projects/USBtoSerial/Descriptors.c b/Projects/USBtoSerial/Descriptors.c index c60da313efa73a2a822b3c02b1f494fc5e83de94..16d3429d4f08a28817bc85feeb72112647332761 100644 --- a/Projects/USBtoSerial/Descriptors.c +++ b/Projects/USBtoSerial/Descriptors.c @@ -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); diff --git a/Projects/USBtoSerial/Descriptors.h b/Projects/USBtoSerial/Descriptors.h index 07a361385fd8e0d82346f383972bbcbefc94f7b8..8012ebdde99707c48dd44d4d560e24d5570e2716 100644 --- a/Projects/USBtoSerial/Descriptors.h +++ b/Projects/USBtoSerial/Descriptors.h @@ -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 diff --git a/Projects/USBtoSerial/Lib/LightweightRingBuff.h b/Projects/USBtoSerial/Lib/LightweightRingBuff.h index 0ffe792dcc39c5b5493688353ff6854e9a6a4c07..1d6e07fded9085b4f289f429be402c5be2b9ab70 100644 --- a/Projects/USBtoSerial/Lib/LightweightRingBuff.h +++ b/Projects/USBtoSerial/Lib/LightweightRingBuff.h @@ -100,7 +100,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { @@ -141,7 +142,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_Insert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_Insert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { *Buffer->In = Data; diff --git a/Projects/Webserver/Descriptors.h b/Projects/Webserver/Descriptors.h index a13ee013f515748614d705c1a902ef59afb96736..b7d15e48fefdfc9614d48fa149fc6fa8e510d570 100644 --- a/Projects/Webserver/Descriptors.h +++ b/Projects/Webserver/Descriptors.h @@ -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 diff --git a/Projects/Webserver/Lib/DHCPClientApp.c b/Projects/Webserver/Lib/DHCPClientApp.c index 7f822538ecdd3df93caf6d0d93a43ea3169908aa..2260b5089b23afd0e9af0f12ad998a4422d91fe0 100644 --- a/Projects/Webserver/Lib/DHCPClientApp.c +++ b/Projects/Webserver/Lib/DHCPClientApp.c @@ -170,13 +170,15 @@ void DHCPClientApp_Callback(void) /** Fills the DHCP packet response with the appropriate BOOTP header for DHCP. This fills out all the required * fields, leaving only the additional DHCP options to be added to the packet before it is sent to the DHCP server. * - * \param[out] DHCPHeader Location in the packet buffer where the BOOTP header should be written to + * \param[out] DHCPHeader Location in the packet buffer where the BOOTP header should be written to * \param[in] DHCPMessageType DHCP Message type, such as DHCP_DISCOVER - * \param[in] AppState Application state of the current UDP connection + * \param[in] AppState Application state of the current UDP connection * * \return Size in bytes of the created DHCP packet */ -static uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* const DHCPHeader, const uint8_t DHCPMessageType, uip_udp_appstate_t* AppState) +static uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* const DHCPHeader, + const uint8_t DHCPMessageType, + uip_udp_appstate_t* const AppState) { /* Erase existing packet data so that we start will all 0x00 DHCP header data */ memset(DHCPHeader, 0, sizeof(DHCP_Header_t)); @@ -215,7 +217,10 @@ static uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* const DHCPHeader, co * * \return Number of bytes added to the DHCP packet */ -static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, void* OptionData) +static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, + const uint8_t Option, + const uint8_t DataLen, + void* const OptionData) { /* Skip through the DHCP options list until the terminator option is found */ while (*DHCPOptionList != DHCP_OPTION_END) @@ -239,7 +244,9 @@ static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, * * \return Boolean true if the option was found in the DHCP packet's options list, false otherwise */ -static bool DHCPClientApp_GetOption(const uint8_t* DHCPOptionList, const uint8_t Option, void* const Destination) +static bool DHCPClientApp_GetOption(const uint8_t* DHCPOptionList, + const uint8_t Option, + void* const Destination) { /* Look through the incoming DHCP packet's options list for the requested option */ while (*DHCPOptionList != DHCP_OPTION_END) diff --git a/Projects/Webserver/Lib/DHCPClientApp.h b/Projects/Webserver/Lib/DHCPClientApp.h index 02d30c8bc0295f5b3bf04e56a14d1c4a3a346514..710f4b61acf729e92969afc25cb2f4f96ce45aba 100644 --- a/Projects/Webserver/Lib/DHCPClientApp.h +++ b/Projects/Webserver/Lib/DHCPClientApp.h @@ -160,10 +160,15 @@ void DHCPClientApp_Callback(void); #if defined(INCLUDE_FROM_DHCPCLIENTAPP_C) - static uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* const DHCPHeader, const uint8_t DHCPMessageType, - uip_udp_appstate_t* AppState); - static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option, uint8_t DataLen, - void* OptionData); - static bool DHCPClientApp_GetOption(const uint8_t* DHCPOptionList, const uint8_t Option, void* const Destination); + static uint16_t DHCPClientApp_FillDHCPHeader(DHCP_Header_t* const DHCPHeader, + const uint8_t DHCPMessageType, + uip_udp_appstate_t* const AppState); + static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, + const uint8_t Option, + const uint8_t DataLen, + void* const OptionData); + static bool DHCPClientApp_GetOption(const uint8_t* DHCPOptionList, + const uint8_t Option, + void* const Destination); #endif #endif diff --git a/Projects/Webserver/Lib/DataflashManager.c b/Projects/Webserver/Lib/DataflashManager.c index 48c4fa7e6ae8d9e3a4ba4344256c22e72d0cc924..1750e15b3eb3ed06855faf8f5706c073d7b733d9 100644 --- a/Projects/Webserver/Lib/DataflashManager.c +++ b/Projects/Webserver/Lib/DataflashManager.c @@ -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, const uint8_t* BufferPtr) +void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, + uint16_t TotalBlocks, + const 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); diff --git a/Projects/Webserver/Lib/DataflashManager.h b/Projects/Webserver/Lib/DataflashManager.h index ebf0bd32931b8a066d9f040ed5e61d070ef28561..20f21c65d7413ef6315dd597cf3ece6dd552e874 100644 --- a/Projects/Webserver/Lib/DataflashManager.h +++ b/Projects/Webserver/Lib/DataflashManager.h @@ -66,13 +66,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, const 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); diff --git a/Projects/Webserver/Lib/SCSI.c b/Projects/Webserver/Lib/SCSI.c index cdc37c936671a73e9a8d95916b8e321233c2d15c..7c40a3db7cfd4435a4ce78e61048bd6a3c0be4e9 100644 --- a/Projects/Webserver/Lib/SCSI.c +++ b/Projects/Webserver/Lib/SCSI.c @@ -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]); diff --git a/Projects/Webserver/Lib/SCSI.h b/Projects/Webserver/Lib/SCSI.h index d0c485bd93a23bbd51c84c83b8283e725920f440..3171c489910bf4d7d0f00c12b91fcebced9b619d 100644 --- a/Projects/Webserver/Lib/SCSI.h +++ b/Projects/Webserver/Lib/SCSI.h @@ -79,7 +79,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 diff --git a/Projects/Webserver/USBHostMode.h b/Projects/Webserver/USBHostMode.h index 1b30f6ad674c2b9d2a0b75f37188faf7ba51b6aa..ab2be12177f61739a3bdc6686ee6bad6f16733eb 100644 --- a/Projects/Webserver/USBHostMode.h +++ b/Projects/Webserver/USBHostMode.h @@ -52,7 +52,8 @@ void EVENT_USB_Host_HostError(const uint8_t ErrorCode); void EVENT_USB_Host_DeviceAttached(void); void EVENT_USB_Host_DeviceUnattached(void); - void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode); + void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, + const uint8_t SubErrorCode); void EVENT_USB_Host_DeviceEnumerationComplete(void); #endif diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.c b/Projects/XPLAINBridge/AVRISPDescriptors.c index 397cb56ca5f894c8c37407c8553cb54c9f5f0afd..c85f4561b16242cc59c1d2214a11bd4642b2f32e 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.c +++ b/Projects/XPLAINBridge/AVRISPDescriptors.c @@ -172,7 +172,9 @@ USB_Descriptor_String_t PROGMEM AVRISP_SerialString = * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. */ -uint16_t AVRISP_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) +uint16_t AVRISP_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); diff --git a/Projects/XPLAINBridge/AVRISPDescriptors.h b/Projects/XPLAINBridge/AVRISPDescriptors.h index 7731aca0d71c4167008676bdb6a97f197017bf85..970035138df53c1cde6ccdc331eee24d11e95f40 100644 --- a/Projects/XPLAINBridge/AVRISPDescriptors.h +++ b/Projects/XPLAINBridge/AVRISPDescriptors.h @@ -73,6 +73,8 @@ } AVRISP_USB_Descriptor_Configuration_t; /* Function Prototypes: */ - uint16_t AVRISP_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress); + uint16_t AVRISP_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress); #endif diff --git a/Projects/XPLAINBridge/Lib/LightweightRingBuff.h b/Projects/XPLAINBridge/Lib/LightweightRingBuff.h index 0ffe792dcc39c5b5493688353ff6854e9a6a4c07..1d6e07fded9085b4f289f429be402c5be2b9ab70 100644 --- a/Projects/XPLAINBridge/Lib/LightweightRingBuff.h +++ b/Projects/XPLAINBridge/Lib/LightweightRingBuff.h @@ -100,7 +100,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_AtomicInsert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { @@ -141,7 +142,8 @@ * \param[in,out] Buffer Pointer to a ring buffer structure to insert into * \param[in] Data Data element to insert into the buffer */ - static inline void RingBuffer_Insert(RingBuff_t* const Buffer, RingBuff_Data_t Data) + static inline void RingBuffer_Insert(RingBuff_t* const Buffer, + const RingBuff_Data_t Data) { *Buffer->In = Data; diff --git a/Projects/XPLAINBridge/Lib/SoftUART.h b/Projects/XPLAINBridge/Lib/SoftUART.h index d0b03c04b362d9190fd31e17c22681a5a02f1a59..7203b3a0dfd84f542b4ef8965c94776c8f9169a6 100644 --- a/Projects/XPLAINBridge/Lib/SoftUART.h +++ b/Projects/XPLAINBridge/Lib/SoftUART.h @@ -60,6 +60,6 @@ } /* Function Prototypes: */ - void SoftUART_Init(void); + void SoftUART_Init(void); #endif \ No newline at end of file diff --git a/Projects/XPLAINBridge/USARTDescriptors.c b/Projects/XPLAINBridge/USARTDescriptors.c index 159f38609af3302c059e593f6366ecd70691aa03..9871305b0e3d6eee70521bc45bf74c691071899d 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.c +++ b/Projects/XPLAINBridge/USARTDescriptors.c @@ -221,7 +221,9 @@ USB_Descriptor_String_t PROGMEM USART_ProductString = /** Descriptor retrieval function for the USART Bridge descriptors. This function is in turn called by the GetDescriptor * callback function in the main source file, to retrieve the device's descriptors when in USART bridge mode. */ -uint16_t USART_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) +uint16_t USART_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); diff --git a/Projects/XPLAINBridge/USARTDescriptors.h b/Projects/XPLAINBridge/USARTDescriptors.h index 5654a3bbd59eed67f5e62c78486292500c73f3fa..194dbe70acb97b6d01259165e1e608446e5b2c60 100644 --- a/Projects/XPLAINBridge/USARTDescriptors.h +++ b/Projects/XPLAINBridge/USARTDescriptors.h @@ -77,6 +77,8 @@ } USART_USB_Descriptor_Configuration_t; /* Function Prototypes: */ - uint16_t USART_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress); + uint16_t USART_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress); #endif diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c index 2e8e6a89ec2180efd96673ac2c18c631520d8a51..28354812f5f2c562dbb4e2d5ead5597ddc923aad 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.c +++ b/Projects/XPLAINBridge/XPLAINBridge.c @@ -240,8 +240,16 @@ void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCI * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. + * + * \param[in] wValue Descriptor type and index to retrieve + * \param[in] wIndex Sub-index to retrieve (such as a localized string language) + * \param[out] DescriptorAddress Address of the retrieved descriptor + * + * \return Length of the retrieved descriptor in bytes, or NO_DESCRIPTOR if the descriptor was not found */ -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) { /* Return the correct descriptors based on the selected mode */ if (CurrentFirmwareMode == MODE_USART_BRIDGE) diff --git a/Projects/XPLAINBridge/XPLAINBridge.h b/Projects/XPLAINBridge/XPLAINBridge.h index fcb1776330d19d293147a97f55c715310cec7ead..ee747ee1a9735b925fb346589c2d47f4f7dfade6 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.h +++ b/Projects/XPLAINBridge/XPLAINBridge.h @@ -93,6 +93,8 @@ void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); - 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