aboutsummaryrefslogtreecommitdiffstats
path: root/fw/types.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-10-02 17:13:22 -0400
committerSam Anthony <sam@samanthony.xyz>2025-10-02 17:13:22 -0400
commite7baf2e96f1cec2071cb2e1e6a4735c36611bc26 (patch)
tree98cc783b42aed7090680a158b00d5549233d3528 /fw/types.c
parent99be520563834d51eb3ddd32b757a3dcd2486632 (diff)
downloadcan-gauge-interface-e7baf2e96f1cec2071cb2e1e6a4735c36611bc26.zip
dac fw module
Diffstat (limited to 'fw/types.c')
-rw-r--r--fw/types.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fw/types.c b/fw/types.c
index a6c2411..d87c891 100644
--- a/fw/types.c
+++ b/fw/types.c
@@ -11,3 +11,9 @@ addU16(U16 *a, U8 b) {
a->hi++;
}
}
+
+void
+lshiftU16(U16 *a, U8 b) {
+ a->hi = (U8)(a->hi << b) | (a->lo >> (8u-b));
+ a->lo <<= b;
+}