aboutsummaryrefslogtreecommitdiffstats
path: root/fw/signal.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-11-01 18:07:33 -0400
committerSam Anthony <sam@samanthony.xyz>2025-11-01 18:07:33 -0400
commit0debe2b2b20818a6899c0635847306d75f86f978 (patch)
tree96e22a808991a91ccc832c69db828ad2120bc466 /fw/signal.c
parentad0456a48388acf9eff97cf4912e0911189b480e (diff)
downloadcan-gauge-interface-0debe2b2b20818a6899c0635847306d75f86f978.zip
fix compiler warnings
Diffstat (limited to 'fw/signal.c')
-rw-r--r--fw/signal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fw/signal.c b/fw/signal.c
index 2bbb716..d724091 100644
--- a/fw/signal.c
+++ b/fw/signal.c
@@ -9,7 +9,7 @@
// Extract a little-endian value from a frame.
// Assumes signal is within the frame's DATA FIELD.
-Status
+void
pluckLE(const SigFmt *sig, const CanFrame *frame, U32 *raw) {
U8 i, end, mask, byte;
@@ -20,7 +20,7 @@ pluckLE(const SigFmt *sig, const CanFrame *frame, U32 *raw) {
// Subsequent iterations start at bit 0 of each byte.
for (i = sig->start; i < end; i += 8u-(i%8u)) {
- mask = 0xFF << (i%8u);
+ mask = (U8)(0xFF << (i%8u));
if (i/8u == end/8u) { // if end in this byte
mask &= 0xFF >> (8u - (end%8u)); // ignore top bits
}
@@ -42,7 +42,7 @@ pluckBE(const SigFmt *sig, const CanFrame *frame, U32 *raw) {
// Subsequent iterations start at bit 0 of each byte.
for (i = sig->start; i < end; i += 8u-(i%8u)) {
- mask = 0xFF << (i%8u);
+ mask = (U8)(0xFF << (i%8u));
if (i/8u == end/8u) { // if end in this byte
mask &= 0xFF >> (8u - (end%8u)); // ignore top bits
*raw <<= (end%8u) - (i%8u); // include bits between i and end