aboutsummaryrefslogtreecommitdiffstats
path: root/fw/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'fw/types.h')
-rw-r--r--fw/types.h43
1 files changed, 21 insertions, 22 deletions
diff --git a/fw/types.h b/fw/types.h
index 7532c6b..55a17f6 100644
--- a/fw/types.h
+++ b/fw/types.h
@@ -13,28 +13,27 @@ typedef enum {
} Status;
typedef uint8_t U8;
+typedef uint16_t U16;
+typedef uint32_t U32;
+
typedef int8_t I8;
+typedef int16_t I16;
+typedef int32_t I32;
+// Number
typedef struct {
- U8 hi, lo;
-} U16;
-
-// Little-endian 32-bit unsigned integer.
-typedef U8 U32[4];
-
-// a + b
-U16 addU16(U16 a, U16 b);
-
-// a + b
-U16 addU16U8(U16 a, U8 b);
-
-// a << b
-U16 lshiftU16(U16 a, U8 b);
-
-// a >> b
-U16 rshiftU16(U16 a, U8 b);
-
-// -1 if a < b
-// 0 if a == b
-// +1 if a > b
-I8 cmpU16(U16 a, U16 b);
+ enum {
+ NUM_U8,
+ NUM_U16,
+ NUM_U32,
+ NUM_I8,
+ NUM_I16,
+ NUM_I32,
+ } type;
+ U8 u8;
+ U16 u16;
+ U32 u32;
+ I8 i8;
+ I16 i16;
+ I32 i32;
+} Number;