return (p[1] << 8) | p[0];
}
+static inline uint get_u16_be(byte *p)
+{
+ return (p[0] << 8) | p[1];
+}
+
+static inline uint get_u32_le(byte *p)
+{
+ return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+}
+
+static inline uint get_u32_be(byte *p)
+{
+ return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
+}
+
static inline void put_u16_le(byte *p, u16 x)
{
p[0] = x;
p[3] = x & 0xff;
}
+static inline void put_u32_le(byte *p, u32 x)
+{
+ p[3] = x >> 24;
+ p[2] = (x >> 16) & 0xff;
+ p[1] = (x >> 8) & 0xff;
+ p[0] = x & 0xff;
+}
+
// debug.c
-#define DEBUG_SEMIHOSTING
+// #define DEBUG_SEMIHOSTING
+// #define DEBUG_USART USART1
void debug_printf(const char *fmt, ...);
void debug_puts(const char *s);