aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJosh Allen <axlecrusher@gmail.com>2017-02-13 21:22:00 -0500
committerJosh Allen <axlecrusher@gmail.com>2017-02-13 21:22:00 -0500
commitf0e743ccc98397ee011ea10a6068263b5f3dbae7 (patch)
tree619008b4f39e272a97b31ee88d2d0f4eb42d449c /tools
parentc67f528d10f55e34d0d254fb59494778bcb04e90 (diff)
downloadlibsurvive-f0e743ccc98397ee011ea10a6068263b5f3dbae7.tar.gz
libsurvive-f0e743ccc98397ee011ea10a6068263b5f3dbae7.tar.bz2
rename function for half float to float
Diffstat (limited to 'tools')
-rw-r--r--tools/ootx_decode/ootx_decoder.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/ootx_decode/ootx_decoder.c b/tools/ootx_decode/ootx_decoder.c
index 5c64898..b5a7b54 100644
--- a/tools/ootx_decode/ootx_decoder.c
+++ b/tools/ootx_decode/ootx_decoder.c
@@ -153,7 +153,7 @@ uint8_t* get_ptr(uint8_t* data, uint8_t bytes, uint16_t* idx) {
return x;
}
-float _to_float(uint8_t* data) {
+float _half_to_float(uint8_t* data) {
//this will not handle infinity, NaN, or denormalized floats
uint16_t x = *(uint16_t*)data;
@@ -198,21 +198,21 @@ void init_lighthouse_info_v6(lighthouse_info_v6* lhi, uint8_t* data) {
lhi->fw_version = *(uint16_t*)get_ptr(data,sizeof(uint16_t),&idx);
lhi->id = *(uint32_t*)get_ptr(data,sizeof(uint32_t),&idx);
- lhi->fcal_0_phase = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_1_phase = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_0_tilt = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_1_tilt = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_0_phase = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_1_phase = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_0_tilt = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_1_tilt = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
lhi->sys_unlock_count = *get_ptr(data,sizeof(uint8_t),&idx);
lhi->hw_version = *get_ptr(data,sizeof(uint8_t),&idx);
- lhi->fcal_0_curve = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_1_curve = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_0_curve = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_1_curve = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
lhi->accel_dir_x = *(int8_t*)get_ptr(data,sizeof(uint8_t),&idx);
lhi->accel_dir_y = *(int8_t*)get_ptr(data,sizeof(uint8_t),&idx);
lhi->accel_dir_z = *(int8_t*)get_ptr(data,sizeof(uint8_t),&idx);
- lhi->fcal_0_gibphase = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_1_gibphase = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_0_gibmag = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
- lhi->fcal_1_gibmag = _to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_0_gibphase = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_1_gibphase = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_0_gibmag = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
+ lhi->fcal_1_gibmag = _half_to_float( get_ptr(data,sizeof(uint16_t),&idx) );
lhi->mode_current = *get_ptr(data,sizeof(uint8_t),&idx);
lhi->sys_faults = *get_ptr(data,sizeof(uint8_t),&idx);