diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c index 24685b9..ccedec6 100644 --- a/device-functions.c +++ b/device-functions.c @@ -77,6 +77,22 @@ static float get_bounded_float (float val_in, float default_val) } +static float get_float_with_min (float val_in, float default_val) +{ + // limits returned value within +2 / -0 order of magnitude + + if (val_in > 100.0 * default_val) { + return default_val; + } + + if (val_in < default_val) { + return default_val; + } + + return val_in; +} + + void idn_string(gchar** response) { *response = g_strdup_printf ("AVTECH ELECTROSYSTEMS,%s,SN:%s,v%s", |