diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-11-01 18:07:33 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-11-01 18:07:33 -0400 |
| commit | 0debe2b2b20818a6899c0635847306d75f86f978 (patch) | |
| tree | 96e22a808991a91ccc832c69db828ad2120bc466 /fw/signal.c | |
| parent | ad0456a48388acf9eff97cf4912e0911189b480e (diff) | |
| download | can-gauge-interface-0debe2b2b20818a6899c0635847306d75f86f978.zip | |
fix compiler warnings
Diffstat (limited to 'fw/signal.c')
| -rw-r--r-- | fw/signal.c | 6 |
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 |