treewide: Use CONFIG_*_ENDIAN instead of __BYTE_ORDER__

In order to avoid using multiple sources of truth for the platfom's
endianness, convert the in-tree code to use the (BIG|LITTLE)_ENDIAN
Kconfig variables exclusively, instead of the compiler's
__BYTE_ORDER__.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2022-10-26 17:25:02 +02:00 committed by Stephanos Ioannidis
commit 8e4d499fa0
17 changed files with 170 additions and 241 deletions

View file

@ -39,12 +39,10 @@ extern "C" {
#define CO_USE_LEDS 1
#endif
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#ifdef CONFIG_LITTLE_ENDIAN
#define CO_LITTLE_ENDIAN
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define CO_BIG_ENDIAN
#else
#error "Unsupported endianness"
#define CO_BIG_ENDIAN
#endif
typedef bool bool_t;