Skip to content

Commit

Permalink
uartbone: define endianness functions for xpack risc-v newlib nano ba…
Browse files Browse the repository at this point in the history
…sed toolchain

Signed-off-by: Yann Sionneau <[email protected]>
  • Loading branch information
fallen committed Mar 3, 2024
1 parent 776722c commit c4f9d41
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions software/libuartbone/uartbone.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# define be16toh(x) betoh16(x)
# define be32toh(x) betoh32(x)
# define be64toh(x) betoh64(x)
#elif defined(__riscv) // workaround for xpack newlib nano based toolchain
#include <machine/endian.h>
#define htobe16(_x) __htons(_x)
#define htobe32(_x) __htonl(_x)
#define htobe64(_x) ({ printf("unsupported 64 bit endianness conversion\n"); abort(); 0; })
#define be32toh(_x) __ntohl(_x)
#endif

#include "uartbone.h"
Expand Down

0 comments on commit c4f9d41

Please sign in to comment.