diff options
author | Joshua Allen <axlecrusher@gmail.com> | 2017-02-25 14:34:10 -0500 |
---|---|---|
committer | Joshua Allen <axlecrusher@gmail.com> | 2017-02-25 14:34:10 -0500 |
commit | 3baabd2f8aa69a986bbb29739e6353d9a95336c5 (patch) | |
tree | 28b9b6907d71fdf153d70178cd03e15fe18b0195 /src/survive_config.c | |
parent | bf096a3e3dfa67a9776e47eb0e651b46ee4e8319 (diff) | |
download | libsurvive-3baabd2f8aa69a986bbb29739e6353d9a95336c5.tar.gz libsurvive-3baabd2f8aa69a986bbb29739e6353d9a95336c5.tar.bz2 |
float to FLT
Diffstat (limited to 'src/survive_config.c')
-rw-r--r-- | src/survive_config.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/survive_config.c b/src/survive_config.c index 42c2c89..254e52f 100644 --- a/src/survive_config.c +++ b/src/survive_config.c @@ -19,11 +19,11 @@ void config_init() { used_entries = 0; } -void write_float(char* tag, float x) { +void write_float(char* tag, FLT x) { fprintf(config_file, "\"%s\":\"%f\"\n", tag, x); } -void write_float_a(char* tag, float *x, uint8_t count) { +void write_float_a(char* tag, FLT *x, uint8_t count) { uint8_t i = 0; char idx[4]; for (i=0;i<count;++i) { @@ -48,15 +48,6 @@ void config_close() { void config_write_lighthouse(struct BaseStationData* bsd, uint8_t length) { uint8_t i = 0; - float Position[3]; - float Quaternion[4]; - uint32_t BaseStationID; - float fcalphase[2]; - float fcaltilt[2]; - float fcalcurve[2]; - float fcalgibpha[2]; - float fcalgibmag[2]; - for (i=0;i<length; ++i) { write_uint32("id", bsd[i].BaseStationID); write_float_a("position", bsd[i].Position, 3); @@ -112,7 +103,7 @@ uint32_t config_read_uint32(const char *tag, const uint32_t value, const uint32_ return config_values[i].numeric.i; } -float config_read_float(const char *tag, const float value, const float def) { +FLT config_read_float(const char *tag, const FLT value, const FLT def) { uint16_t i = 0; for (i=0;i<used_entries;++i) { if ( strcmp(config_values[i].tag, tag) == 0 ) { @@ -152,7 +143,7 @@ const uint32_t config_set_uint32(const char *tag, const uint32_t value) { return value; } -const float config_set_float(const char *tag, const float value) { +const FLT config_set_float(const char *tag, const FLT value) { uint16_t i = 0; assert(used_entries<MAX_CONFIG_ENTRIES); @@ -179,4 +170,5 @@ void config_save(const char* path) { }; fclose(f); -}
\ No newline at end of file +} + |