Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
test_bswap.c File Reference
#include <inttypes.h>
#include "mcu.h"
+ Include dependency graph for test_bswap.c:

Go to the source code of this file.

Macros

#define MyByteSwap16(n)
 
#define MyByteSwap32(n)
 
#define MyByteSwap32_1(in, out)
 
#define MyByteSwap16_1(in, out)
 

Functions

int main (void)
 

Macro Definition Documentation

◆ MyByteSwap16

#define MyByteSwap16 (   n)
Value:
( ((((uint16_t) n) << 8) & 0xFF00) | \
((((uint16_t) n) >> 8) & 0x00FF) )

Definition at line 6 of file test_bswap.c.

◆ MyByteSwap16_1

#define MyByteSwap16_1 (   in,
  out 
)
Value:
asm volatile ( \
"rev16 %0, %1\n\t" \
: "=r" (out) \
: "r"(in) \
);

Definition at line 24 of file test_bswap.c.

◆ MyByteSwap32

#define MyByteSwap32 (   n)
Value:
( ((((uint32_t) n) << 24) & 0xFF000000) | \
((((uint32_t) n) << 8) & 0x00FF0000) | \
((((uint32_t) n) >> 8) & 0x0000FF00) | \
((((uint32_t) n) >> 24) & 0x000000FF) )

Definition at line 10 of file test_bswap.c.

◆ MyByteSwap32_1

#define MyByteSwap32_1 (   in,
  out 
)
Value:
asm volatile ( \
"rev %0, %1\n\t" \
: "=r" (out) \
: "r"(in) \
);

Definition at line 16 of file test_bswap.c.

Function Documentation

◆ main()

int main ( void  )

Definition at line 33 of file test_bswap.c.

References b, foo, MyByteSwap16, MyByteSwap16_1, MyByteSwap32, and MyByteSwap32_1.

uint16_t
unsigned short uint16_t
Definition: types.h:16
uint32_t
unsigned long uint32_t
Definition: types.h:18