Commit 97143bf8 authored by Dean Camera's avatar Dean Camera
Browse files

Add missing const qualifiers to class drivers.

Indent core library function parameters so that there is only one parameter per line, to increase readability.
parent 99d8a393
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* \param[in] BlockAddress Data block starting address for the write sequence * \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write * \param[in] TotalBlocks Number of blocks of data to write
*/ */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* 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 CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE); uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
...@@ -181,7 +181,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co ...@@ -181,7 +181,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co
* \param[in] BlockAddress Data block starting address for the read sequence * \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read * \param[in] TotalBlocks Number of blocks of data to read
*/ */
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* 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 CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE); uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
......
...@@ -67,9 +67,9 @@ ...@@ -67,9 +67,9 @@
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE) #define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
/* Function Prototypes: */ /* Function Prototypes: */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks); uint16_t TotalBlocks);
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks); 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); uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
......
...@@ -86,7 +86,7 @@ SCSI_Request_Sense_Response_t SenseData = ...@@ -86,7 +86,7 @@ SCSI_Request_Sense_Response_t SenseData =
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
/* Set initial sense data, before the requested command is processed */ /* Set initial sense data, before the requested command is processed */
SCSI_SET_SENSE(SCSI_SENSE_KEY_GOOD, SCSI_SET_SENSE(SCSI_SENSE_KEY_GOOD,
...@@ -136,7 +136,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -136,7 +136,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]); uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);
uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength : uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :
...@@ -173,7 +173,7 @@ static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -173,7 +173,7 @@ static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]; uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];
uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData); uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
...@@ -193,7 +193,7 @@ static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf ...@@ -193,7 +193,7 @@ static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1); uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1);
uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE; uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE;
...@@ -212,7 +212,7 @@ static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface ...@@ -212,7 +212,7 @@ static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
/* Check to see if the SELF TEST bit is not set */ /* Check to see if the SELF TEST bit is not set */
if (!(MSInterfaceInfo->State.CommandBlock.SCSICommandData[1] & (1 << 2))) if (!(MSInterfaceInfo->State.CommandBlock.SCSICommandData[1] & (1 << 2)))
...@@ -247,7 +247,7 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI ...@@ -247,7 +247,7 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \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) * \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* 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]); uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
uint16_t TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); uint16_t TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
......
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
#define DEVICE_TYPE_CDROM 0x05 #define DEVICE_TYPE_CDROM 0x05
/* Function Prototypes: */ /* Function Prototypes: */
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
#if defined(INCLUDE_FROM_SCSI_C) #if defined(INCLUDE_FROM_SCSI_C)
static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); 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* 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* 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* MSInterfaceInfo, const bool IsDataRead); static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead);
#endif #endif
#endif #endif
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* \param[in] BlockAddress Data block starting address for the write sequence * \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write * \param[in] TotalBlocks Number of blocks of data to write
*/ */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* 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 CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE); uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
...@@ -181,7 +181,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co ...@@ -181,7 +181,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co
* \param[in] BlockAddress Data block starting address for the read sequence * \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read * \param[in] TotalBlocks Number of blocks of data to read
*/ */
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* 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 CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE); uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
......
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
#define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS) #define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS)
/* Function Prototypes: */ /* Function Prototypes: */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks); uint16_t TotalBlocks);
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks); 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); uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
......
...@@ -86,7 +86,7 @@ SCSI_Request_Sense_Response_t SenseData = ...@@ -86,7 +86,7 @@ SCSI_Request_Sense_Response_t SenseData =
* *
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with * \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/ */
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
bool CommandSuccess = false; bool CommandSuccess = false;
...@@ -146,7 +146,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -146,7 +146,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
* *
* \return Boolean true if the command completed successfully, false otherwise. * \return Boolean true if the command completed successfully, false otherwise.
*/ */
static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]); uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);
uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength : uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :
...@@ -187,7 +187,7 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -187,7 +187,7 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
* *
* \return Boolean true if the command completed successfully, false otherwise. * \return Boolean true if the command completed successfully, false otherwise.
*/ */
static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]; uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];
uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData); uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
...@@ -211,7 +211,7 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf ...@@ -211,7 +211,7 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf
* *
* \return Boolean true if the command completed successfully, false otherwise. * \return Boolean true if the command completed successfully, false otherwise.
*/ */
static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1); uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1);
uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE; uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE;
...@@ -234,7 +234,7 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface ...@@ -234,7 +234,7 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface
* *
* \return Boolean true if the command completed successfully, false otherwise. * \return Boolean true if the command completed successfully, false otherwise.
*/ */
static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
{ {
uint8_t ReturnByte; uint8_t ReturnByte;
...@@ -300,7 +300,7 @@ static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI ...@@ -300,7 +300,7 @@ static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
* *
* \return Boolean true if the command completed successfully, false otherwise. * \return Boolean true if the command completed successfully, false otherwise.
*/ */
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const bool IsDataRead) static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead)
{ {
uint32_t BlockAddress; uint32_t BlockAddress;
uint16_t TotalBlocks; uint16_t TotalBlocks;
......
...@@ -74,14 +74,14 @@ ...@@ -74,14 +74,14 @@
#define DEVICE_TYPE_CDROM 0x05 #define DEVICE_TYPE_CDROM 0x05
/* Function Prototypes: */ /* Function Prototypes: */
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
#if defined(INCLUDE_FROM_SCSI_C) #if defined(INCLUDE_FROM_SCSI_C)
static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInfo); 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* 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* 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* MSInterfaceInfo, const bool IsDataRead); static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo, const bool IsDataRead);
#endif #endif
#endif #endif
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#include "BoardTypes.h" #include "BoardTypes.h"
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
/** Macro for encasing other multi-statement macros. This should be used along with an opening brace /** Macro for encasing other multi-statement macros. This should be used along with an opening brace
* before the start of any multi-statement macro, so that the macros contents as a whole are treated * before the start of any multi-statement macro, so that the macros contents as a whole are treated
* as a discrete block and not as a list of separate statements which may cause problems when used as * as a discrete block and not as a list of separate statements which may cause problems when used as
...@@ -172,8 +172,8 @@ ...@@ -172,8 +172,8 @@
* *
* \param[in] Word Word of data whose bytes are to be swapped. * \param[in] Word Word of data whose bytes are to be swapped.
*/ */
static inline uint16_t SwapEndian_16(uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST; static inline uint16_t SwapEndian_16(const uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
static inline uint16_t SwapEndian_16(uint16_t Word) static inline uint16_t SwapEndian_16(const uint16_t Word)
{ {
uint8_t Temp; uint8_t Temp;
...@@ -198,8 +198,8 @@ ...@@ -198,8 +198,8 @@
* *
* \param[in] DWord Double word of data whose bytes are to be swapped. * \param[in] DWord Double word of data whose bytes are to be swapped.
*/ */
static inline uint32_t SwapEndian_32(uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST; static inline uint32_t SwapEndian_32(const uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST;
static inline uint32_t SwapEndian_32(uint32_t DWord) static inline uint32_t SwapEndian_32(const uint32_t DWord)
{ {
uint8_t Temp; uint8_t Temp;
...@@ -229,8 +229,10 @@ ...@@ -229,8 +229,10 @@
* \param[in,out] Data Pointer to a number containing an even number of bytes to be reversed. * \param[in,out] Data Pointer to a number containing an even number of bytes to be reversed.
* \param[in] Bytes Length of the data in bytes. * \param[in] Bytes Length of the data in bytes.
*/ */
static inline void SwapEndian_n(void* Data, uint8_t Bytes); static inline void SwapEndian_n(void* Data,
static inline void SwapEndian_n(void* Data, uint8_t Bytes) uint8_t Bytes) ATTR_NON_NULL_PTR_ARG(1);
static inline void SwapEndian_n(void* Data,
uint8_t Bytes)
{ {
uint8_t* CurrDataPos = (uint8_t*)Data; uint8_t* CurrDataPos = (uint8_t*)Data;
......
...@@ -112,7 +112,8 @@ ...@@ -112,7 +112,8 @@
PORTD = (PORTD & ~LEDS_ALL_LEDS) | (LEDMask & LEDS_ALL_LEDS); PORTD = (PORTD & ~LEDS_ALL_LEDS) | (LEDMask & LEDS_ALL_LEDS);
} }
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)
{ {
PORTD = ((PORTD & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS)); PORTD = ((PORTD & ~(LEDMask & LEDS_ALL_LEDS)) | (ActiveMask & LEDS_ALL_LEDS));
} }
......
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
PORTC = ((PORTC | LEDS_ALL_LEDS) & ~LEDMask); 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 | ActiveMask) & ~LEDMask); PORTC = ((PORTC | ActiveMask) & ~LEDMask);
} }
......
...@@ -114,7 +114,8 @@ ...@@ -114,7 +114,8 @@
PORTB = ((PORTB & ~LEDS_ALL_LEDS) | LedMask); PORTB = ((PORTB & ~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)
{ {
PORTB = ((PORTB & ~LedMask) | ActiveMask); PORTB = ((PORTB & ~LedMask) | ActiveMask);
} }
......
...@@ -221,7 +221,8 @@ ...@@ -221,7 +221,8 @@
* \param[in] PageAddress Page address within the selected dataflash IC. * \param[in] PageAddress Page address within the selected dataflash IC.
* \param[in] BufferByte Address within the dataflash's buffer. * \param[in] BufferByte Address within the dataflash's buffer.
*/ */
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte); static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte);
/* Disable C linkage for C++ Compilers: */ /* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus) #if defined(__cplusplus)
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
* \param[in] PageAddress Page address within the selected dataflash IC * \param[in] PageAddress Page address within the selected dataflash IC
* \param[in] BufferByte Address within the dataflash's buffer * \param[in] BufferByte Address within the dataflash's buffer
*/ */
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte) static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
{ {
Dataflash_SendByte(PageAddress >> 5); Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8)); Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
......
...@@ -106,7 +106,8 @@ ...@@ -106,7 +106,8 @@
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); PORTD = ((PORTD & ~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)
{ {
PORTD = ((PORTD & ~LEDMask) | ActiveMask); PORTD = ((PORTD & ~LEDMask) | ActiveMask);
} }
......
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); PORTD = ((PORTD & ~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)
{ {
PORTD = ((PORTD & ~LEDMask) | ActiveMask); PORTD = ((PORTD & ~LEDMask) | ActiveMask);
} }
......
...@@ -163,7 +163,8 @@ ...@@ -163,7 +163,8 @@
* \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file). * \param[in] LEDMask Mask of the board LEDs to manipulate (see board-specific LEDs.h driver file).
* \param[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off. * \param[in] ActiveMask Mask of whether the LEDs in the LED mask should be turned on or off.
*/ */
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);
/** Toggles all LEDs in the LED mask, leaving all others in their current states. /** Toggles all LEDs in the LED mask, leaving all others in their current states.
* *
......
...@@ -129,7 +129,8 @@ ...@@ -129,7 +129,8 @@
~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT)); ~((LEDMask & LEDS_PORTE_LEDS) << LEDS_PORTE_MASK_SHIFT));
} }
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)
{ {
PORTD = (((PORTD & ~(LEDMask & LEDS_LED1)) | (ActiveMask & LEDS_LED1)) | PORTD = (((PORTD & ~(LEDMask & LEDS_LED1)) | (ActiveMask & LEDS_LED1)) |
((PORTD | (LEDMask & LEDS_LED2)) & ~(ActiveMask & LEDS_LED2))); ((PORTD | (LEDMask & LEDS_LED2)) & ~(ActiveMask & LEDS_LED2)));
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
* \param[in] PageAddress Page address within the selected dataflash IC * \param[in] PageAddress Page address within the selected dataflash IC
* \param[in] BufferByte Address within the dataflash's buffer * \param[in] BufferByte Address within the dataflash's buffer
*/ */
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte) static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
{ {
Dataflash_SendByte(PageAddress >> 6); Dataflash_SendByte(PageAddress >> 6);
Dataflash_SendByte((PageAddress << 2) | (BufferByte >> 8)); Dataflash_SendByte((PageAddress << 2) | (BufferByte >> 8));
......
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); PORTD = ((PORTD & ~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)
{ {
PORTD = ((PORTD & ~LEDMask) | ActiveMask); PORTD = ((PORTD & ~LEDMask) | ActiveMask);
} }
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
* \param[in] PageAddress Page address within the selected dataflash IC * \param[in] PageAddress Page address within the selected dataflash IC
* \param[in] BufferByte Address within the dataflash's buffer * \param[in] BufferByte Address within the dataflash's buffer
*/ */
static inline void Dataflash_SendAddressBytes(uint16_t PageAddress, const uint16_t BufferByte) static inline void Dataflash_SendAddressBytes(uint16_t PageAddress,
const uint16_t BufferByte)
{ {
Dataflash_SendByte(PageAddress >> 5); Dataflash_SendByte(PageAddress >> 5);
Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8)); Dataflash_SendByte((PageAddress << 3) | (BufferByte >> 8));
......
...@@ -109,7 +109,8 @@ ...@@ -109,7 +109,8 @@
PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask); PORTD = ((PORTD & ~LEDS_ALL_LEDS) | LEDMask);
} }