aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/canutil/write.c2
-rw-r--r--src/canutil/write.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/canutil/write.c b/src/canutil/write.c
index 3b3ae25d..7f3a3e04 100644
--- a/src/canutil/write.c
+++ b/src/canutil/write.c
@@ -2,7 +2,7 @@
#include <bitfield/bitfield.h>
#include <bitfield/8byte.h>
-static uint64_t float_to_fixed_point(const float value, const float factor,
+uint64_t float_to_fixed_point(const float value, const float factor,
const float offset) {
float raw = (value - offset) / factor;
if(raw > 0) {
diff --git a/src/canutil/write.h b/src/canutil/write.h
index 28b7e052..c2bef20e 100644
--- a/src/canutil/write.h
+++ b/src/canutil/write.h
@@ -26,6 +26,9 @@ extern "C" {
uint64_t eightbyte_encode_float(float value, uint8_t bit_offset,
uint8_t bit_size, float factor, float offset);
+uint64_t float_to_fixed_point(const float value, const float factor,
+ const float offset);
+
bool bitfield_encode_float(const float value, const uint8_t bit_offset,
const uint8_t bit_size, const float factor, const float offset,
uint8_t destination[], const uint8_t destination_length);