]> mj.ucw.cz Git - home-hw.git/blobdiff - Inc/util.h
BMP over USB
[home-hw.git] / Inc / util.h
index 827cc9c4a09082cf23336f38c7de54c5b3de9ace..0beed7c87232f5748061bc26b52585eb2524b8ea 100644 (file)
@@ -22,6 +22,20 @@ static inline void put_u16_le(byte *p, u16 x)
   p[1] = x >> 8;
 }
 
+static inline void put_u16_be(byte *p, u16 x)
+{
+  p[0] = x >> 8;
+  p[1] = x;
+}
+
+static inline void put_u32_be(byte *p, u32 x)
+{
+  p[0] = x >> 24;
+  p[1] = (x >> 16) & 0xff;
+  p[2] = (x >> 8) & 0xff;
+  p[3] = x & 0xff;
+}
+
 // debug.c
 
 #define DEBUG_SEMIHOSTING