byteorder: Add macros for converting ints to arrays
Add three macros: sys_uint{16,32,64}_to_array, to convert
integers to byte arrays in a byte order aware manner.
For example, sys_uint16_to_array(0x0123) evaluates to:
{0x01, 0x23} for big endian machines, and {0x23, 0x01} for
little endian machines.
Signed-off-by:
Yonatan Schachter <yonatan.schachter@gmail.com>
Loading
Please sign in to comment