diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-11-01 20:32:55 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-11-01 20:32:55 -0400 |
| commit | b71dd676b5ebe3feec1eb2194e20453a3d01705d (patch) | |
| tree | 10e19b6fa21d27c97376cdaf2bcfa03c05b2a75a /fw/table.h | |
| parent | 96a85a2bb8e52cb8b15745bca617e3cc788d02ad (diff) | |
| download | can-gauge-interface-b71dd676b5ebe3feec1eb2194e20453a3d01705d.zip | |
lookup output value in table
Diffstat (limited to 'fw/table.h')
| -rw-r--r-- | fw/table.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |