aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel/MassStorageHost
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-21 16:19:32 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-21 16:19:32 +0000
commit6bda628718f67c04ed43e8328f55bdce5319c504 (patch)
treeefd08eefa90cef94440f880a70902f5803fb12a7 /Demos/Host/LowLevel/MassStorageHost
parent83e293a6ec98c7faad1b76dd312b31b86cbeecc1 (diff)
downloadlufa-6bda628718f67c04ed43e8328f55bdce5319c504.tar.gz
lufa-6bda628718f67c04ed43e8328f55bdce5319c504.tar.bz2
lufa-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 'Demos/Host/LowLevel/MassStorageHost')
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c34
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h37
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c6
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/MassStorageHost.h6
4 files changed, 54 insertions, 29 deletions
diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
index 129c50af8..b94bbcac7 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 aa349946c..5c1e80b51 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 2739fc99a..985aeeb08 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 14d8d9734..7aabe9f7d 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