You should use the style of inttypes.h but define the symbols yourself.
For example:
#define PRIu8 "hhu"
#define PRId8 "hhd"
#define PRIx8 "hhx"
#define PRIu16 "hu"
#define PRId16 "hd"
#define PRIx16 "hx"
#define PRIu32 "u"
#define PRId32 "d"
#define PRIx32 "x"
#define PRIu64 "llu" // or possibly "lu"
#define PRId64 "lld" // or possibly "ld"
#define PRIx64 "llx" // or possibly "lx"
Figure them out for your machine and use them. Take a look at others in inttypes.h and figure which you will need.
This way, your code will be more portable. I've been doing embedded systems work since the late 70's. Trust me: portability is important.
%u
expects anunsigned int
, not auint16_t
. The cast should be tounsigned int
. – Decomposed