#include <stdint.h>
+#include <stdbool.h>
typedef unsigned int uint;
typedef uint8_t byte;
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))
+static inline uint get_u16_le(byte *p)
+{
+ return (p[1] << 8) | p[0];
+}
+
+static inline void put_u16_le(byte *p, u16 x)
+{
+ p[0] = x;
+ p[1] = x >> 8;
+}
+
// debug.c
#define DEBUG_SEMIHOSTING