diff --git a/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c b/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c index 3df39814e7..6680a6ba60 100644 --- a/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c +++ b/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c @@ -88,8 +88,10 @@ void Serial_SendString(const char* StringPtr) void Serial_SendData(const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(*((uint8_t*)Buffer++)); + Serial_SendByte(*(CurrByte++)); } void Serial_CreateStream(FILE* Stream) diff --git a/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c b/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c index f86bd9789a..b7a39d3c2d 100644 --- a/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c +++ b/LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c @@ -91,8 +91,10 @@ void Serial_SendData(USART_t* const USART, const void* Buffer, uint16_t Length) { + uint8_t* CurrByte = (uint8_t*)Buffer; + while (Length--) - Serial_SendByte(USART, *((uint8_t*)Buffer++)); + Serial_SendByte(USART, *(CurrByte++)); } void Serial_CreateStream(USART_t* USART, FILE* Stream)