aboutsummaryrefslogtreecommitdiffstats
path: root/fw/table.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-11-01 20:32:55 -0400
committerSam Anthony <sam@samanthony.xyz>2025-11-01 20:32:55 -0400
commitb71dd676b5ebe3feec1eb2194e20453a3d01705d (patch)
tree10e19b6fa21d27c97376cdaf2bcfa03c05b2a75a /fw/table.h
parent96a85a2bb8e52cb8b15745bca617e3cc788d02ad (diff)
downloadcan-gauge-interface-b71dd676b5ebe3feec1eb2194e20453a3d01705d.zip
lookup output value in table
Diffstat (limited to 'fw/table.h')
-rw-r--r--fw/table.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/fw/table.h b/fw/table.h
index cba263d..a5cfb7b 100644
--- a/fw/table.h
+++ b/fw/table.h
@@ -22,7 +22,7 @@
enum {
TAB_KEY_SIZE = sizeof(U32),
- TAB_VAL_SIZE = sizeof(U32),
+ TAB_VAL_SIZE = sizeof(U16),
TAB_ROWS = 32,
TAB_ROW_SIZE = TAB_KEY_SIZE + TAB_VAL_SIZE,
TAB_SIZE = TAB_ROWS * TAB_ROW_SIZE,
@@ -33,12 +33,12 @@ typedef struct {
} Table;
// Set the key and value of row k.
-Status tabWrite(const Table *tab, U8 k, U16 key, U16 val);
+Status tabWrite(const Table *tab, U8 k, U32 key, U16 val);
// Read row k.
-Status tabRead(const Table *tab, U8 k, U16 *key, U16 *val);
+Status tabRead(const Table *tab, U8 k, U32 *key, U16 *val);
// Lookup the value associated with given key.
// If key falls between two rows, the value is interpolated
// from the two adjacent.
-Status tabLookup(const Table *tab, U16 key, U16 *val);
+Status tabLookup(const Table *tab, Number key, U16 *val);