Skip to content
Commit 111b181b authored by Yonatan Schachter's avatar Yonatan Schachter Committed by Anas Nashif
Browse files

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: default avatarYonatan Schachter <yonatan.schachter@gmail.com>
parent 6e188d97
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment