From 9e34144c9b7454ab69215c17d75a8ba2dcdcb929 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 28 Apr 2010 14:33:10 +0000 Subject: Use puts_P() and printf_P() instead of the normal variants where possible in the Host mode Class Driver demos. --- LUFA/Common/Common.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'LUFA/Common') diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index 5f1b2eae5..a59a213a8 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -164,18 +164,18 @@ * \param[in,out] Data Pointer to a number containing an even number of bytes to be reversed * \param[in] Bytes Length of the data in bytes */ - static inline void SwapEndian_n(uint8_t* Data, uint8_t Bytes); - static inline void SwapEndian_n(uint8_t* Data, uint8_t Bytes) + static inline void SwapEndian_n(void* Data, uint8_t Bytes); + static inline void SwapEndian_n(void* Data, uint8_t Bytes) { - uint8_t Temp; - + uint8_t* CurrDataPos = Data; + while (Bytes) { - Temp = *Data; - *Data = *(Data + Bytes - 1); - *(Data + Bytes - 1) = Temp; + uint8_t Temp = *CurrDataPos; + *CurrDataPos = *(CurrDataPos + Bytes - 1); + *(CurrDataPos + Bytes - 1) = Temp; - Data++; + CurrDataPos++; Bytes -= 2; } } -- cgit v1.2.3