aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Kenga <muharred@gmail.com>2014-09-15 12:24:11 +0300
committerAnthony Kenga <muharred@gmail.com>2014-09-15 12:24:11 +0300
commit50f7e27d13e3dfc4b94f17a06f29d775e47627f9 (patch)
tree17bab8a85594e0742358c7af767dae5a8451fb1e
parent21367222379d6ae3b1c5c774942ac2aac5ca32cb (diff)
downloadpx4-firmware-50f7e27d13e3dfc4b94f17a06f29d775e47627f9.tar.gz
px4-firmware-50f7e27d13e3dfc4b94f17a06f29d775e47627f9.tar.bz2
px4-firmware-50f7e27d13e3dfc4b94f17a06f29d775e47627f9.zip
Fixed parameter storage to support struct parameters.
-rw-r--r--src/modules/systemlib/param/param.c3
-rw-r--r--src/modules/systemlib/param/param.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c
index e44e6cdb0..6b8d0e634 100644
--- a/src/modules/systemlib/param/param.c
+++ b/src/modules/systemlib/param/param.c
@@ -322,7 +322,8 @@ param_get_value_ptr(param_t param)
v = &param_info_base[param].val;
}
- if (param_type(param) == PARAM_TYPE_STRUCT) {
+ if (param_type(param) >= PARAM_TYPE_STRUCT
+ && param_type(param) <= PARAM_TYPE_STRUCT_MAX) {
result = v->p;
} else {
diff --git a/src/modules/systemlib/param/param.h b/src/modules/systemlib/param/param.h
index 084cd931a..dc73b37e9 100644
--- a/src/modules/systemlib/param/param.h
+++ b/src/modules/systemlib/param/param.h
@@ -307,7 +307,7 @@ __EXPORT int param_load_default(void);
struct param_info_s __param__##_name = { \
#_name, \
PARAM_TYPE_STRUCT + sizeof(_default), \
- .val.p = &_default; \
+ .val.p = &_default \
}
/**