mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-26 10:58:49 +08:00
2011-11-09 Werner Almesberger <werner@almesberger.net>
PR 1955/cpukit * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2011-11-09 Werner Almesberger <werner@almesberger.net>
|
||||
|
||||
PR 1955/cpukit
|
||||
* rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline.
|
||||
|
||||
2011-09-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
PR 1914/cpukit
|
||||
|
||||
@@ -1258,8 +1258,10 @@ static inline uint32_t CPU_swap_u32(
|
||||
* @param[in] value is the value to be swapped
|
||||
* @return the value after being endian swapped
|
||||
*/
|
||||
#define CPU_swap_u16( value ) \
|
||||
(((value&0xff) << 8) | ((value >> 8)&0xff))
|
||||
static inline uint16_t CPU_swap_u16(uint16_t v)
|
||||
{
|
||||
return v << 8 | v >> 8;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user