diff options
author | Dean Camera <[email protected]> | 2010-07-21 16:19:32 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2010-07-21 16:19:32 +0000 |
commit | 6bda628718f67c04ed43e8328f55bdce5319c504 (patch) | |
tree | efd08eefa90cef94440f880a70902f5803fb12a7 /Projects | |
parent | 83e293a6ec98c7faad1b76dd312b31b86cbeecc1 (diff) | |
download | qmk_firmware-6bda628718f67c04ed43e8328f55bdce5319c504.tar.gz qmk_firmware-6bda628718f67c04ed43e8328f55bdce5319c504.zip |
Update all demos, projects and bootloaders to indent all function parameters, one per line, for better readability.
Add missing const qualifiers to the demos.
Diffstat (limited to 'Projects')
62 files changed, 302 insertions, 129 deletions
diff --git a/Projects/AVRISP-MKII/Descriptors.c b/Projects/AVRISP-MKII/Descriptors.c index 95a41f18a5..243c570203 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 f946899760..f991aa0226 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 430c9158a9..2df8710eb4 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 34d623ed70..869e0e58b4 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 bc3ed18e09..56b18f60ac 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 d93aaddbf8..4b7e189133 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 150f64244d..d45e42a1a9 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 2daca16fcf..cbb2c27aac 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 3ca9dd9f45..6a9e791bbf 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 07a361385f..8012ebdde9 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 0ffe792dcc..1d6e07fded 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 640c832244..9ce300afc5 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 9933d060e5..fc648de4b2 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 d6ffde8045..cd2b0d3b89 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 440259341e..d78bbba207 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 f54b25be45..b274a10835 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 8f62219ca7..406ae62afe 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 74f6811ad5..0bf6abdf71 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 3927a4fda3..22c3a1d449 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 dff45fcb2b..dfb8a9f3a6 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 decd2b0549..c43cfc8bcc 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 67d0deb8b7..316ad45eb7 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 017e3fe1ef..387034f11d 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 c544ba6357..219ead1e71 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 02a14b4007..85d0737806 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 8be527b4db..c1b21039c6 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 dff4d2e5d9..973c7c26cc 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 e404eaf0e1..4c0d7a191a 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 4922b7be68..946ef2ebfb 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 dcc6e732f6..c76dc52f4a 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 aba261611d..57aae09922 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 ca353d51ff..e792aec7eb 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 7b217fbcf1..f6357f8212 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 00a4d70fe2..564d5ee83c 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 a2ab5852e4..ff0d25cff6 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 003160fe2b..a85aa6176d 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 58eac8e5c9..d07bff4396 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 48c4fa7e6a..1750e15b3e 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 3c75c4c757..70dd88d21e 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 fb841e34bc..390441aa11 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 fd739182eb..c5504b7133 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 e7c7c763e7..dd707bc085 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 48a051f0a1..45cb3bec1b 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 c60da313ef..16d3429d4f 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 07a361385f..8012ebdde9 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 0ffe792dcc..1d6e07fded 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 a13ee013f5..b7d15e48fe 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 7f822538ec..2260b5089b 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 02d30c8bc0..710f4b61ac 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 48c4fa7e6a..1750e15b3e 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 ebf0bd3293..20f21c65d7 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 cdc37c9366..7c40a3db7c 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 d0c485bd93..3171c48991 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 1b30f6ad67..ab2be12177 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 397cb56ca5..c85f4561b1 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 7731aca0d7..970035138d 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 0ffe792dcc..1d6e07fded 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 d0b03c04b3..7203b3a0df 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 159f38609a..9871305b0e 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 5654a3bbd5..194dbe70ac 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 2e8e6a89ec..28354812f5 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 fcb1776330..ee747ee1a9 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 |