diff options
author | Andreas Antener <antener_a@gmx.ch> | 2015-02-04 09:33:14 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-10 08:39:46 +0100 |
commit | a7580a1eae5a5fe8f2a7e70a1447009fed91645e (patch) | |
tree | a7c23d2c7dcdc1bae821f5100a5964723b1bfb6d /src | |
parent | 28e943ca28f10cc1ea205a0e18cf814c8a2afa52 (diff) | |
download | px4-firmware-a7580a1eae5a5fe8f2a7e70a1447009fed91645e.tar.gz px4-firmware-a7580a1eae5a5fe8f2a7e70a1447009fed91645e.tar.bz2 px4-firmware-a7580a1eae5a5fe8f2a7e70a1447009fed91645e.zip |
added actual tests and fixed reset-exclude funtction
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/systemlib/param/param.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/systemlib/param/param.c b/src/modules/systemlib/param/param.c index 7ff71a802..926ae75a7 100644 --- a/src/modules/systemlib/param/param.c +++ b/src/modules/systemlib/param/param.c @@ -504,15 +504,22 @@ param_reset_excludes(const char* excludes[], int num_excludes) for (param = 0; handle_in_range(param); param++) { const char* name = param_name(param); + bool exclude = false; + + for (int index = 0; index < num_excludes; index ++) { + int len = strlen(excludes[index]); - for (int index = 0, len = strlen(excludes[index]); index < num_excludes; index ++) { if((excludes[index][len - 1] == '*' - && strncmp(name, excludes[index], len - 1)) == 0 + && strncmp(name, excludes[index], len - 1) == 0) || strcmp(name, excludes[index]) == 0) { - - param_reset(param); + exclude = true; + break; } } + + if(!exclude) { + param_reset(param); + } } param_unlock(); |