mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 21:01:31 +00:00
Fix void pointer arithmetic in the Serial peripheral drivers.
This commit is contained in:
parent
59b9cf8d0f
commit
0b69eeaf5d
@ -88,8 +88,10 @@ void Serial_SendString(const char* StringPtr)
|
|||||||
void Serial_SendData(const void* Buffer,
|
void Serial_SendData(const void* Buffer,
|
||||||
uint16_t Length)
|
uint16_t Length)
|
||||||
{
|
{
|
||||||
|
uint8_t* CurrByte = (uint8_t*)Buffer;
|
||||||
|
|
||||||
while (Length--)
|
while (Length--)
|
||||||
Serial_SendByte(*((uint8_t*)Buffer++));
|
Serial_SendByte(*(CurrByte++));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Serial_CreateStream(FILE* Stream)
|
void Serial_CreateStream(FILE* Stream)
|
||||||
|
@ -91,8 +91,10 @@ void Serial_SendData(USART_t* const USART,
|
|||||||
const void* Buffer,
|
const void* Buffer,
|
||||||
uint16_t Length)
|
uint16_t Length)
|
||||||
{
|
{
|
||||||
|
uint8_t* CurrByte = (uint8_t*)Buffer;
|
||||||
|
|
||||||
while (Length--)
|
while (Length--)
|
||||||
Serial_SendByte(USART, *((uint8_t*)Buffer++));
|
Serial_SendByte(USART, *(CurrByte++));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Serial_CreateStream(USART_t* USART, FILE* Stream)
|
void Serial_CreateStream(USART_t* USART, FILE* Stream)
|
||||||
|
Loading…
Reference in New Issue
Block a user