diff options
Diffstat (limited to 'src/canutil/read.c')
-rw-r--r-- | src/canutil/read.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/canutil/read.c b/src/canutil/read.c index fddf75e3..4864a60f 100644 --- a/src/canutil/read.c +++ b/src/canutil/read.c @@ -2,15 +2,21 @@ #include <bitfield/bitfield.h> #include <bitfield/8byte.h> -float bitfield_parse_float(uint64_t data, uint8_t bit_offset, uint8_t bit_size, +float eightbyte_parse_float(uint64_t data, uint8_t bit_offset, uint8_t bit_size, float factor, float offset) { - uint64_t raw = get_bit_field(data, bit_offset, - bit_size, true); + uint64_t raw = eightbyte_get_bit_field(data, bit_offset, bit_size, true); return raw * factor + offset; } -bool bitfield_parse_bool(uint64_t data, uint8_t bit_offset, uint8_t bit_size, +bool eightbyte_parse_bool(uint64_t data, uint8_t bit_offset, uint8_t bit_size, float factor, float offset) { - float value = bitfield_parse_float(data, bit_offset, bit_size, factor, offset); + float value = eightbyte_parse_float(data, bit_offset, bit_size, factor, offset); return value == 0.0 ? false : true; } + +float bitfield_parse_float(const uint8_t data[], const uint16_t size, + const uint8_t bit_offset, const uint8_t bit_size, const float factor, + const float offset) { + //TODO + return 0; +} |