aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-04-28 14:33:10 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-04-28 14:33:10 +0000
commit9e34144c9b7454ab69215c17d75a8ba2dcdcb929 (patch)
treea8bf00bba0faa5aa75b4d6d721eec40cc8a1ad4c /LUFA/Common
parent0063f721173b38155648a4267703825fb136fc3e (diff)
downloadlufa-9e34144c9b7454ab69215c17d75a8ba2dcdcb929.tar.gz
lufa-9e34144c9b7454ab69215c17d75a8ba2dcdcb929.tar.bz2
lufa-9e34144c9b7454ab69215c17d75a8ba2dcdcb929.zip
Use puts_P() and printf_P() instead of the normal variants where possible in the Host mode Class Driver demos.
Diffstat (limited to 'LUFA/Common')
-rw-r--r--LUFA/Common/Common.h16
1 files changed, 8 insertions, 8 deletions
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;
}
}