diff options
author | inmarket <andrewh@inmarket.com.au> | 2017-09-23 09:30:02 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2017-09-23 09:30:02 +1000 |
commit | 2513b54e71090572b2cf5789389c866b22a47068 (patch) | |
tree | c4a569d7a67126c53a40ab78b79dc64788891b63 /src/gdisp/gdisp_image_support.h | |
parent | ecfcf994c635ffd47d0f166c43f02a034d16729e (diff) | |
download | uGFX-2513b54e71090572b2cf5789389c866b22a47068.tar.gz uGFX-2513b54e71090572b2cf5789389c866b22a47068.tar.bz2 uGFX-2513b54e71090572b2cf5789389c866b22a47068.zip |
Fix image byte extraction macros
Diffstat (limited to 'src/gdisp/gdisp_image_support.h')
-rw-r--r-- | src/gdisp/gdisp_image_support.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gdisp/gdisp_image_support.h b/src/gdisp/gdisp_image_support.h index a3cdc86f..9fefd3d6 100644 --- a/src/gdisp/gdisp_image_support.h +++ b/src/gdisp/gdisp_image_support.h @@ -21,11 +21,11 @@ #define gdispImageGetVar(type, p, idx) (*(type *)(((uint8_t *)(p))+(idx))) #define gdispImageGetByte(type, p, idx, shift) (((type)gdispImageGetVar(uint8_t, p, idx))<<(shift)) #define gdispImageSwap16(w) ((((uint16_t)(w))>>8)|(((uint16_t)(w))<<8)) -#define gdispImageSwap32(dw) ((((uint32_t)(w))>>24)|((((uint32_t)(w))&0x00FF0000)>>8)\ - |((((uint32_t)(w))&0x0000FF00)<<8)|(((uint32_t)(w))<<24)) -#define gdispImageSwapWords32(dw) ((((uint32_t)(w))>>16)|(((uint32_t)(w))<<16)) -#define gdispImageSwapBytes32(dw) (((((uint32_t)(w))&0xFF000000)>>8)|((((uint32_t)(w))&0x00FF0000)<<8)\ - |((((uint32_t)(w))&0x0000FF00)>>8)|(((uint32_t)(w))<<8)) +#define gdispImageSwap32(dw) ((((uint32_t)(dw))>>24)|((((uint32_t)(dw))&0x00FF0000)>>8)\ + |((((uint32_t)(dw))&0x0000FF00)<<8)|(((uint32_t)(dw))<<24)) +#define gdispImageSwapWords32(dw) ((((uint32_t)(dw))>>16)|(((uint32_t)(dw))<<16)) +#define gdispImageSwapBytes32(dw) (((((uint32_t)(dw))&0xFF000000)>>8)|((((uint32_t)(dw))&0x00FF0000)<<8)\ + |((((uint32_t)(dw))&0x0000FF00)>>8)|(((uint32_t)(dw))<<8)) /* * Get a uint16_t/uint32_t from memory in the required endianness. @@ -120,7 +120,6 @@ #endif - #ifdef __cplusplus extern "C" { #endif |