Update all demos, projects and bootloaders to indent all function parameters, one per line, for better readability.
Add missing const qualifiers to the demos.
This commit is contained in:
parent
83e293a6ec
commit
6bda628718
271 changed files with 1312 additions and 621 deletions
|
@ -272,7 +272,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -312,7 +312,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -272,7 +272,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -312,7 +312,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -338,7 +338,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -110,7 +110,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -87,7 +87,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -141,7 +141,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
|
|||
*
|
||||
* \return Boolean true if the new report differs from the last report, false otherwise
|
||||
*/
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData)
|
||||
{
|
||||
static uint8_t PrevJoyStatus = 0;
|
||||
static uint8_t PrevButtonStatus = 0;
|
||||
|
|
|
@ -87,6 +87,6 @@
|
|||
void EVENT_USB_Device_ConfigurationChanged(void);
|
||||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* ReportData);
|
||||
bool GetNextReport(USB_JoystickReport_Data_t* const ReportData);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -216,7 +216,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -92,7 +92,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -257,7 +257,7 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \param[out] ReportData Pointer to a HID report data structure to be filled
|
||||
*/
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData)
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* const ReportData)
|
||||
{
|
||||
uint8_t JoyStatus_LCL = Joystick_GetStatus();
|
||||
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
|
||||
|
@ -291,7 +291,7 @@ void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData)
|
|||
*
|
||||
* \param[in] LEDReport LED status report from the host
|
||||
*/
|
||||
void ProcessLEDReport(uint8_t LEDReport)
|
||||
void ProcessLEDReport(const uint8_t LEDReport)
|
||||
{
|
||||
uint8_t LEDMask = LEDS_LED2;
|
||||
|
||||
|
|
|
@ -144,8 +144,8 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);
|
||||
void ProcessLEDReport(uint8_t LEDReport);
|
||||
void CreateKeyboardReport(USB_KeyboardReport_Data_t* const ReportData);
|
||||
void ProcessLEDReport(const uint8_t LEDReport);
|
||||
void SendNextReport(void);
|
||||
void ReceiveNextReport(void);
|
||||
|
||||
|
|
|
@ -286,7 +286,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -98,7 +98,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -183,7 +183,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -174,7 +174,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -65,7 +65,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
* \param[in] BlockAddress Data block starting address for the write sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
*/
|
||||
void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_WriteBlocks(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -179,7 +180,8 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
|
|||
* \param[in] BlockAddress Data block starting address for the read sequence
|
||||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
*/
|
||||
void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
|
||||
void DataflashManager_ReadBlocks(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -287,7 +289,9 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc
|
|||
* \param[in] TotalBlocks Number of blocks of data to write
|
||||
* \param[in] BufferPtr Pointer to the data source RAM buffer
|
||||
*/
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
@ -386,7 +390,9 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
|
|||
* \param[in] TotalBlocks Number of blocks of data to read
|
||||
* \param[out] BufferPtr Pointer to the data destination RAM buffer
|
||||
*/
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr)
|
||||
{
|
||||
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
|
||||
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
|
||||
|
|
|
@ -74,11 +74,15 @@
|
|||
#define LUN_MEDIA_BLOCKS (VIRTUAL_MEMORY_BLOCKS / TOTAL_LUNS)
|
||||
|
||||
/* Function Prototypes: */
|
||||
void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks);
|
||||
void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks);
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_WriteBlocks(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_ReadBlocks(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks);
|
||||
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
|
||||
void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
|
||||
uint16_t TotalBlocks,
|
||||
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
|
||||
void DataflashManager_ResetDataflashProtections(void);
|
||||
bool DataflashManager_CheckDataflashOperation(void);
|
||||
|
|
|
@ -199,7 +199,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress)
|
||||
{
|
||||
const uint8_t DescriptorType = (wValue >> 8);
|
||||
const uint8_t DescriptorNumber = (wValue & 0xFF);
|
||||
|
|
|
@ -87,7 +87,8 @@
|
|||
#define DTYPE_Report 0x22
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -226,7 +226,7 @@ void EVENT_USB_Device_StartOfFrame(void)
|
|||
*
|
||||
* \param[out] ReportData Pointer to a HID report data structure to be filled
|
||||
*/
|
||||
void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
|
||||
void CreateMouseReport(USB_MouseReport_Data_t* const ReportData)
|
||||
{
|
||||
uint8_t JoyStatus_LCL = Joystick_GetStatus();
|
||||
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
|
||||
|
|
|
@ -107,6 +107,6 @@
|
|||
void EVENT_USB_Device_UnhandledControlRequest(void);
|
||||
void EVENT_USB_Device_StartOfFrame(void);
|
||||
|
||||
void CreateMouseReport(USB_MouseReport_Data_t* ReportData);
|
||||
void CreateMouseReport(USB_MouseReport_Data_t* const ReportData);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -91,7 +91,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart)
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
DecodeARPHeader(InDataStart);
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
} ARP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart, void* OutDataStart);
|
||||
int16_t ARP_ProcessARPPacket(void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,9 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart)
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
|
||||
void* DHCPHeaderInStart,
|
||||
void* DHCPHeaderOutStart)
|
||||
{
|
||||
IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
|
||||
DHCP_Header_t* DHCPHeaderIN = (DHCP_Header_t*)DHCPHeaderInStart;
|
||||
|
|
|
@ -120,6 +120,8 @@
|
|||
} DHCP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, void* DHCPHeaderOutStart);
|
||||
int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart,
|
||||
void* DHCPHeaderInStart,
|
||||
void* DHCPHeaderOutStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -120,7 +120,8 @@ void Ethernet_ProcessPacket(void)
|
|||
*
|
||||
* \return A 16-bit Ethernet checksum value
|
||||
*/
|
||||
uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes)
|
||||
uint16_t Ethernet_Checksum16(void* Data,
|
||||
uint16_t Bytes)
|
||||
{
|
||||
uint16_t* Words = (uint16_t*)Data;
|
||||
uint32_t Checksum = 0;
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
|
||||
/* Function Prototypes: */
|
||||
void Ethernet_ProcessPacket(void);
|
||||
uint16_t Ethernet_Checksum16(void* Data, uint16_t Bytes);
|
||||
uint16_t Ethernet_Checksum16(void* Data,
|
||||
uint16_t Bytes);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart)
|
||||
int16_t ICMP_ProcessICMPPacket(void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
ICMP_Header_t* ICMPHeaderIN = (ICMP_Header_t*)InDataStart;
|
||||
ICMP_Header_t* ICMPHeaderOUT = (ICMP_Header_t*)OutDataStart;
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
} ICMP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart);
|
||||
int16_t ICMP_ProcessICMPPacket(void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
* response was generated, NO_PROCESS if the packet processing was deferred until the
|
||||
* next Ethernet packet handler iteration
|
||||
*/
|
||||
int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart)
|
||||
int16_t IP_ProcessIPPacket(void* InDataStart,
|
||||
void* OutDataStart)
|
||||
{
|
||||
DecodeIPHeader(InDataStart);
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
} IP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t IP_ProcessIPPacket(void* InDataStart, void* OutDataStart);
|
||||
int16_t IP_ProcessIPPacket(void* InDataStart,
|
||||
void* OutDataStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -239,7 +239,7 @@ void ProcessRNDISControlMessage(void)
|
|||
*
|
||||
* \return Boolean true if the query was handled, false otherwise
|
||||
*/
|
||||
static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize,
|
||||
static bool ProcessNDISQuery(const uint32_t OId, void* QueryData, uint16_t QuerySize,
|
||||
void* ResponseData, uint16_t* ResponseSize)
|
||||
{
|
||||
/* Handler for REMOTE_NDIS_QUERY_MSG messages */
|
||||
|
|
|
@ -215,9 +215,14 @@
|
|||
void ProcessRNDISControlMessage(void);
|
||||
|
||||
#if defined(INCLUDE_FROM_RNDIS_C)
|
||||
static bool ProcessNDISQuery(uint32_t OId, void* QueryData, uint16_t QuerySize,
|
||||
void* ResponseData, uint16_t* ResponseSize);
|
||||
static bool ProcessNDISSet(uint32_t OId, void* SetData, uint16_t SetSize);
|
||||
static bool ProcessNDISQuery(const uint32_t OId,
|
||||
void* QueryData,
|
||||
uint16_t QuerySize,
|
||||
void* ResponseData,
|
||||
uint16_t* ResponseSize);
|
||||
static bool ProcessNDISSet(const uint32_t OId,
|
||||
void* SetData,
|
||||
uint16_t SetSize);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -175,7 +175,9 @@ void TCP_Init(void)
|
|||
*
|
||||
* \return Boolean true if the port state was set, false otherwise (no more space in the port state table)
|
||||
*/
|
||||
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
|
||||
bool TCP_SetPortState(const uint16_t Port,
|
||||
const uint8_t State,
|
||||
void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -222,7 +224,7 @@ bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_Connecti
|
|||
*
|
||||
* \return A value from the TCP_PortStates_t enum
|
||||
*/
|
||||
uint8_t TCP_GetPortState(uint16_t Port)
|
||||
uint8_t TCP_GetPortState(const uint16_t Port)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -247,7 +249,10 @@ uint8_t TCP_GetPortState(uint16_t Port)
|
|||
*
|
||||
* \return Boolean true if the connection was updated or created, false otherwise (no more space in the connection state table)
|
||||
*/
|
||||
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State)
|
||||
bool TCP_SetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort,
|
||||
const uint8_t State)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -287,7 +292,9 @@ bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t
|
|||
*
|
||||
* \return A value from the TCP_ConnectionStates_t enum
|
||||
*/
|
||||
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
uint8_t TCP_GetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -314,7 +321,9 @@ uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16
|
|||
*
|
||||
* \return ConnectionInfo structure of the connection if found, NULL otherwise
|
||||
*/
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
|
@ -343,7 +352,9 @@ TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAd
|
|||
* response was generated, NO_PROCESS if the packet processing was deferred until the
|
||||
* next Ethernet packet handler iteration
|
||||
*/
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart)
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart,
|
||||
void* TCPHeaderInStart,
|
||||
void* TCPHeaderOutStart)
|
||||
{
|
||||
IP_Header_t* IPHeaderIN = (IP_Header_t*)IPHeaderInStart;
|
||||
TCP_Header_t* TCPHeaderIN = (TCP_Header_t*)TCPHeaderInStart;
|
||||
|
@ -590,8 +601,10 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
|
|||
*
|
||||
* \return A 16-bit TCP checksum value
|
||||
*/
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
|
||||
IP_Address_t DestinationAddress, uint16_t TCPOutSize)
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart,
|
||||
const IP_Address_t SourceAddress,
|
||||
const IP_Address_t DestinationAddress,
|
||||
uint16_t TCPOutSize)
|
||||
{
|
||||
uint32_t Checksum = 0;
|
||||
|
||||
|
|
|
@ -231,16 +231,29 @@
|
|||
/* Function Prototypes: */
|
||||
void TCP_Init(void);
|
||||
void TCP_Task(void);
|
||||
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
|
||||
uint8_t TCP_GetPortState(uint16_t Port);
|
||||
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State);
|
||||
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort);
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void* TCPHeaderOutStart);
|
||||
bool TCP_SetPortState(const uint16_t Port,
|
||||
const uint8_t State,
|
||||
void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*));
|
||||
uint8_t TCP_GetPortState(const uint16_t Port);
|
||||
bool TCP_SetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort,
|
||||
const uint8_t State);
|
||||
uint8_t TCP_GetConnectionState(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort);
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(const uint16_t Port,
|
||||
const IP_Address_t RemoteAddress,
|
||||
const uint16_t RemotePort);
|
||||
int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart,
|
||||
void* TCPHeaderInStart,
|
||||
void* TCPHeaderOutStart);
|
||||
|
||||
#if defined(INCLUDE_FROM_TCP_C)
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddress,
|
||||
IP_Address_t DestinationAddress, uint16_t TCPOutSize);
|
||||
static uint16_t TCP_Checksum16(void* TCPHeaderOutStart,
|
||||
const IP_Address_t SourceAddress,
|
||||
const IP_Address_t DestinationAddress,
|
||||
uint16_t TCPOutSize);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,9 @@
|
|||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
*/
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart)
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart,
|
||||
void* UDPHeaderInStart,
|
||||
void* UDPHeaderOutStart)
|
||||
{
|
||||
UDP_Header_t* UDPHeaderIN = (UDP_Header_t*)UDPHeaderInStart;
|
||||
UDP_Header_t* UDPHeaderOUT = (UDP_Header_t*)UDPHeaderOutStart;
|
||||
|
|
|
@ -65,6 +65,8 @@
|
|||
} UDP_Header_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart, void* UDPHeaderInStart, void* UDPHeaderOutStart);
|
||||
int16_t UDP_ProcessUDPPacket(void* IPHeaderInStart,
|
||||
void* UDPHeaderInStart,
|
||||
void* UDPHeaderOutStart);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -90,7 +90,8 @@ void Webserver_Init(void)
|
|||
*
|
||||
* \return Boolean true if the command matches the request, false otherwise
|
||||
*/
|
||||
static bool IsHTTPCommand(uint8_t* RequestHeader, char* Command)
|
||||
static bool IsHTTPCommand(uint8_t* RequestHeader,
|
||||
char* Command)
|
||||
{
|
||||
/* Returns true if the non null terminated string in RequestHeader matches the null terminated string Command */
|
||||
return (strncmp((char*)RequestHeader, Command, strlen(Command)) == 0);
|
||||
|
@ -102,7 +103,8 @@ static bool IsHTTPCommand(uint8_t* RequestHeader, char* Command)
|
|||
* \param[in] ConnectionState Pointer to a TCP Connection State structure giving connection information
|
||||
* \param[in,out] Buffer Pointer to the application's send/receive packet buffer
|
||||
*/
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer)
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* const ConnectionState,
|
||||
TCP_ConnectionBuffer_t* const Buffer)
|
||||
{
|
||||
char* BufferDataStr = (char*)Buffer->Data;
|
||||
static uint8_t PageBlock = 0;
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
/* Function Prototypes: */
|
||||
void Webserver_Init(void);
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* ConnectionState, TCP_ConnectionBuffer_t* Buffer);
|
||||
void Webserver_ApplicationCallback(TCP_ConnectionState_t* const ConnectionState,
|
||||
TCP_ConnectionBuffer_t* const Buffer);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -91,7 +91,8 @@
|
|||
} USB_Descriptor_Configuration_t;
|
||||
|
||||
/* Function Prototypes: */
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
|
||||
ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
||||
const uint8_t wIndex,
|
||||
void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue