aboutsummaryrefslogtreecommitdiff
path: root/src/systemcmds
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-05-05 11:43:29 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-05-05 11:43:29 +0200
commitbb94847511e76c34cf0fbebe874ed4fd6efe1c0c (patch)
treeff68946c9be6305dfa526d39ce9b5f617db62ddb /src/systemcmds
parent13110e0a1f4df06f1ba175dd4acb7901a47f9b43 (diff)
downloadpx4-firmware-bb94847511e76c34cf0fbebe874ed4fd6efe1c0c.tar.gz
px4-firmware-bb94847511e76c34cf0fbebe874ed4fd6efe1c0c.tar.bz2
px4-firmware-bb94847511e76c34cf0fbebe874ed4fd6efe1c0c.zip
Allowed parsing of floating point params from scripts
Diffstat (limited to 'src/systemcmds')
-rw-r--r--src/systemcmds/param/param.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/systemcmds/param/param.c b/src/systemcmds/param/param.c
index 56f5317e3..60e61d07b 100644
--- a/src/systemcmds/param/param.c
+++ b/src/systemcmds/param/param.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (C) 2012 PX4 Development Team. All rights reserved.
+ * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
* Author: Lorenz Meier <lm@inf.ethz.ch>
*
* Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@
/**
* @file param.c
+ * @author Lorenz Meier <lm@inf.ethz.ch>
*
* Parameter tool.
*/
@@ -262,7 +263,7 @@ do_set(const char* name, const char* val)
switch (param_type(param)) {
case PARAM_TYPE_INT32:
if (!param_get(param, &i)) {
- printf("old: %d", i);
+ printf("curr: %d", i);
/* convert string */
char* end;
@@ -276,14 +277,13 @@ do_set(const char* name, const char* val)
case PARAM_TYPE_FLOAT:
if (!param_get(param, &f)) {
- printf("float values are not yet supported.");
- // printf("old: %4.4f", (double)f);
-
- // /* convert string */
- // char* end;
- // f = strtof(val,&end);
- // param_set(param, &f);
- // printf(" -> new: %4.4f\n", f);
+ printf("curr: %4.4f", (double)f);
+
+ /* convert string */
+ char* end;
+ f = strtod(val,&end);
+ param_set(param, &f);
+ printf(" -> new: %f\n", f);
}