diff options
Diffstat (limited to 'Projects/Webserver/Lib')
| -rw-r--r-- | Projects/Webserver/Lib/DHCPClientApp.c | 17 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/DHCPClientApp.h | 15 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/DataflashManager.c | 16 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/DataflashManager.h | 12 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/SCSI.c | 3 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/SCSI.h | 3 | 
6 files changed, 46 insertions, 20 deletions
| diff --git a/Projects/Webserver/Lib/DHCPClientApp.c b/Projects/Webserver/Lib/DHCPClientApp.c index 7f822538e..2260b5089 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 02d30c8bc..710f4b61a 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 48c4fa7e6..1750e15b3 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 ebf0bd329..20f21c65d 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 cdc37c936..7c40a3db7 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 d0c485bd9..3171c4899 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 | 
