add type conversion in finsh.h file.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@659 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
367015d3fd
commit
760349dd5e
|
@ -30,7 +30,8 @@
|
|||
#define HEAP_ALIGNMENT 4 /* heap alignment */
|
||||
|
||||
#define FINSH_GET16(x) (*(x)) | (*((x)+1) << 8)
|
||||
#define FINSH_GET32(x) (*(x)) | (*((x)+1) << 8) | (*((x)+2) << 16) | (*((x)+3) << 24)
|
||||
#define FINSH_GET32(x) (rt_uint32_t)(*(x)) | (rt_uint32_t)(*((x)+1) << 8) | \
|
||||
(rt_uint32_t)(*((x)+2) << 16) | (rt_uint32_t)(*((x)+3) << 24)
|
||||
|
||||
#define FINSH_SET16(x, v) \
|
||||
do \
|
||||
|
@ -42,10 +43,10 @@
|
|||
#define FINSH_SET32(x, v) \
|
||||
do \
|
||||
{ \
|
||||
*(x) = (v) & 0x000000ff; \
|
||||
(*((x)+1)) = ((v) >> 8) & 0x000000ff; \
|
||||
(*((x)+2)) = ((v) >> 16) & 0x000000ff; \
|
||||
(*((x)+3)) = ((v) >> 24); \
|
||||
*(x) = (rt_uint32_t)(v) & 0x000000ff; \
|
||||
(*((x)+1)) = (rt_uint32_t)((v) >> 8) & 0x000000ff; \
|
||||
(*((x)+2)) = (rt_uint32_t)((v) >> 16) & 0x000000ff; \
|
||||
(*((x)+3)) = (rt_uint32_t)((v) >> 24); \
|
||||
} while ( 0 )
|
||||
|
||||
/* -- the end of option -- */
|
||||
|
|
Loading…
Reference in New Issue