Changed all *_SendByte() function prototypes to accept a void pointer for the input buffer (thanks to Simon Küppers) instead of a uint8_t pointer.

pull/1469/head
Dean Camera 12 years ago
parent 2b4658de2c
commit cfa48f5987

@ -27,6 +27,7 @@
* - Increased throughput in the USBtoSerial project now that data transmission is non-blocking (thanks to Joseph Lacerte) * - Increased throughput in the USBtoSerial project now that data transmission is non-blocking (thanks to Joseph Lacerte)
* - Updated bootloader makefiles to remove dependency on the \c bc command line calculator tool * - Updated bootloader makefiles to remove dependency on the \c bc command line calculator tool
* - Updated AVRISP-MKII Clone Programmer project so that the SCK clock period is saved in EEPROM (thanks to Gerhard Wesser) * - Updated AVRISP-MKII Clone Programmer project so that the SCK clock period is saved in EEPROM (thanks to Gerhard Wesser)
* - Changed all *_SendByte() function prototypes to accept a void pointer for the input buffer (thanks to Simon Küppers)
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Core: * - Core:

@ -85,11 +85,11 @@ void Serial_SendString(const char* StringPtr)
} }
} }
void Serial_SendData(const uint8_t* Buffer, void Serial_SendData(const void* Buffer,
uint16_t Length) uint16_t Length)
{ {
while (Length--) while (Length--)
Serial_SendByte(*(Buffer++)); Serial_SendByte(*((uint8_t*)Buffer++));
} }
void Serial_CreateStream(FILE* Stream) void Serial_CreateStream(FILE* Stream)

@ -136,7 +136,7 @@
* \param[in] Buffer Pointer to a buffer containing the data to send. * \param[in] Buffer Pointer to a buffer containing the data to send.
* \param[in] Length Length of the data to send, in bytes. * \param[in] Length Length of the data to send, in bytes.
*/ */
void Serial_SendData(const uint8_t* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); void Serial_SendData(const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** Creates a standard character stream from the USART so that it can be used with all the regular functions /** Creates a standard character stream from the USART so that it can be used with all the regular functions
* in the avr-libc \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created * in the avr-libc \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created

@ -88,11 +88,11 @@ void Serial_SendString(USART_t* const USART,
} }
void Serial_SendData(USART_t* const USART, void Serial_SendData(USART_t* const USART,
const uint8_t* Buffer, const void* Buffer,
uint16_t Length) uint16_t Length)
{ {
while (Length--) while (Length--)
Serial_SendByte(USART, *(Buffer++)); Serial_SendByte(USART, *((uint8_t*)Buffer++));
} }
void Serial_CreateStream(FILE* Stream) void Serial_CreateStream(FILE* Stream)

@ -139,7 +139,7 @@
* \param[in] Length Length of the data to send, in bytes. * \param[in] Length Length of the data to send, in bytes.
*/ */
void Serial_SendData(USART_t* const USART, void Serial_SendData(USART_t* const USART,
const uint8_t* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1); const void* Buffer, uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
/** Creates a standard character stream from the USART so that it can be used with all the regular functions /** Creates a standard character stream from the USART so that it can be used with all the regular functions
* in the avr-libc \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created * in the avr-libc \c <stdio.h> library that accept a \c FILE stream as a destination (e.g. \c fprintf). The created

@ -156,7 +156,7 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo
} }
uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
const char* const Buffer, const void* const Buffer,
const uint16_t Length) const uint16_t Length)
{ {
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))

@ -197,7 +197,7 @@
* \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Endpoint_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
const char* const Buffer, const void* const Buffer,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when /** Sends a given null terminated string to the attached USB host, if connected. If a host is not connected when

@ -226,7 +226,7 @@ static uint8_t AOA_Host_SendPropertyString(USB_ClassInfo_AOA_Host_t* const AOAIn
} }
uint8_t AOA_Host_SendData(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo, uint8_t AOA_Host_SendData(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo,
const uint8_t* const Buffer, const void* const Buffer,
const uint16_t Length) const uint16_t Length)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(AOAInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(AOAInterfaceInfo->State.IsActive))

@ -175,7 +175,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t AOA_Host_SendData(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo, uint8_t AOA_Host_SendData(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo,
const uint8_t* const Buffer, const void* const Buffer,
const uint16_t Length); const uint16_t Length);
/** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the /** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the

@ -277,7 +277,7 @@ uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
} }
uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
const uint8_t* const Buffer, const void* const Buffer,
const uint16_t Length) const uint16_t Length)
{ {
if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive)) if ((USB_HostState != HOST_STATE_Configured) || !(CDCInterfaceInfo->State.IsActive))

@ -198,7 +198,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, uint8_t CDC_Host_SendData(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo,
const uint8_t* const Buffer, const void* const Buffer,
const uint16_t Length); const uint16_t Length);
/** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the /** Sends a given null-terminated string to the attached USB device, if connected. If a device is not connected when the

@ -275,7 +275,7 @@ uint8_t PRNT_Host_SendString(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
} }
uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
void* Buffer, const void* Buffer,
const uint16_t Length) const uint16_t Length)
{ {
uint8_t ErrorCode; uint8_t ErrorCode;

@ -200,7 +200,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo,
void* Buffer, const void* Buffer,
const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); const uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the /** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the

@ -254,7 +254,7 @@ uint8_t SI_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInf
} }
uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, const void* Buffer,
const uint16_t Bytes) const uint16_t Bytes)
{ {
uint8_t ErrorCode; uint8_t ErrorCode;

@ -260,7 +260,7 @@
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum. * \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
*/ */
uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint8_t SI_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
void* Buffer, const void* Buffer,
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2); const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
/** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data /** Receives arbitrary data from the attached device, for use in the data phase of PIMA commands which require data

@ -24,7 +24,7 @@ upgrade-doxygen:
# Make all possible bootloaders for all targets and configurations as set by the BootloaderTest build test # Make all possible bootloaders for all targets and configurations as set by the BootloaderTest build test
# and store them in a separate directory called "Bootloaders" # and store them in a separate directory called "Bootloaders"
make_bootloaders: bootloaders:
@echo "build_bootloaders:" > BuildMakefile @echo "build_bootloaders:" > BuildMakefile
@printf "\t-mkdir Bootloaders 2>/dev/null\n\n" >> BuildMakefile @printf "\t-mkdir Bootloaders 2>/dev/null\n\n" >> BuildMakefile
@ -79,4 +79,4 @@ validate-branch:
validate-release: check-documentation-placeholders validate-branch validate-release: check-documentation-placeholders validate-branch
.PHONY: all upgrade-doxygen make_bootloaders check-documentation-placeholders validate-branch .PHONY: all upgrade-doxygen bootloaders check-documentation-placeholders validate-branch

Loading…
Cancel
Save