diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-29 11:00:36 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-07-29 11:00:36 +0200 |
commit | db527ee88139ef470007f82675b57ec313cdc495 (patch) | |
tree | f34b0755e69ebb41d295e43c2c6b6a8c301155fa /src/systemcmds/config | |
parent | 95dde5f1bed21d1a36a065c94c961a8f216a10b0 (diff) | |
download | px4-firmware-db527ee88139ef470007f82675b57ec313cdc495.tar.gz px4-firmware-db527ee88139ef470007f82675b57ec313cdc495.tar.bz2 px4-firmware-db527ee88139ef470007f82675b57ec313cdc495.zip |
Removed unused code
Diffstat (limited to 'src/systemcmds/config')
-rw-r--r-- | src/systemcmds/config/config.c | 213 |
1 files changed, 0 insertions, 213 deletions
diff --git a/src/systemcmds/config/config.c b/src/systemcmds/config/config.c index c4b03bbff..2dad2261b 100644 --- a/src/systemcmds/config/config.c +++ b/src/systemcmds/config/config.c @@ -198,216 +198,3 @@ do_accel(int argc, char *argv[]) exit(0); } - -// static void -// do_load(const char* param_file_name) -// { -// int fd = open(param_file_name, O_RDONLY); - -// if (fd < 0) -// err(1, "open '%s'", param_file_name); - -// int result = param_load(fd); -// close(fd); - -// if (result < 0) { -// errx(1, "error importing from '%s'", param_file_name); -// } - -// exit(0); -// } - -// static void -// do_import(const char* param_file_name) -// { -// int fd = open(param_file_name, O_RDONLY); - -// if (fd < 0) -// err(1, "open '%s'", param_file_name); - -// int result = param_import(fd); -// close(fd); - -// if (result < 0) -// errx(1, "error importing from '%s'", param_file_name); - -// exit(0); -// } - -// static void -// do_show(const char* search_string) -// { -// printf(" + = saved, * = unsaved\n"); -// param_foreach(do_show_print, search_string, false); - -// exit(0); -// } - -// static void -// do_show_print(void *arg, param_t param) -// { -// int32_t i; -// float f; -// const char *search_string = (const char*)arg; - -// /* print nothing if search string is invalid and not matching */ -// if (!(arg == NULL || (!strcmp(search_string, param_name(param))))) { -// /* param not found */ -// return; -// } - -// printf("%c %s: ", -// param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'), -// param_name(param)); - -// /* -// * This case can be expanded to handle printing common structure types. -// */ - -// switch (param_type(param)) { -// case PARAM_TYPE_INT32: -// if (!param_get(param, &i)) { -// printf("%d\n", i); -// return; -// } - -// break; - -// case PARAM_TYPE_FLOAT: -// if (!param_get(param, &f)) { -// printf("%4.4f\n", (double)f); -// return; -// } - -// break; - -// case PARAM_TYPE_STRUCT ... PARAM_TYPE_STRUCT_MAX: -// printf("<struct type %d size %u>\n", 0 + param_type(param), param_size(param)); -// return; - -// default: -// printf("<unknown type %d>\n", 0 + param_type(param)); -// return; -// } - -// printf("<error fetching parameter %d>\n", param); -// } - -// static void -// do_set(const char* name, const char* val) -// { -// int32_t i; -// float f; -// param_t param = param_find(name); - -// /* set nothing if parameter cannot be found */ -// if (param == PARAM_INVALID) { -// param not found -// errx(1, "Error: Parameter %s not found.", name); -// } - -// printf("%c %s: ", -// param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'), -// param_name(param)); - -// /* -// * Set parameter if type is known and conversion from string to value turns out fine -// */ - -// switch (param_type(param)) { -// case PARAM_TYPE_INT32: -// if (!param_get(param, &i)) { -// printf("curr: %d", i); - -// /* convert string */ -// char* end; -// i = strtol(val,&end,10); -// param_set(param, &i); -// printf(" -> new: %d\n", i); - -// } - -// break; - -// case PARAM_TYPE_FLOAT: -// if (!param_get(param, &f)) { -// printf("curr: %4.4f", (double)f); - -// /* convert string */ -// char* end; -// f = strtod(val,&end); -// param_set(param, &f); -// printf(" -> new: %f\n", f); - -// } - -// break; - -// default: -// errx(1, "<unknown / unsupported type %d>\n", 0 + param_type(param)); -// } - -// exit(0); -// } - -// static void -// do_compare(const char* name, const char* val) -// { -// int32_t i; -// float f; -// param_t param = param_find(name); - -// /* set nothing if parameter cannot be found */ -// if (param == PARAM_INVALID) { -// /* param not found */ -// errx(1, "Error: Parameter %s not found.", name); -// } - -// /* -// * Set parameter if type is known and conversion from string to value turns out fine -// */ - -// int ret = 1; - -// switch (param_type(param)) { -// case PARAM_TYPE_INT32: -// if (!param_get(param, &i)) { - -// /* convert string */ -// char* end; -// int j = strtol(val,&end,10); -// if (i == j) { -// printf(" %d: ", i); -// ret = 0; -// } - -// } - -// break; - -// case PARAM_TYPE_FLOAT: -// if (!param_get(param, &f)) { - -// /* convert string */ -// char* end; -// float g = strtod(val, &end); -// if (fabsf(f - g) < 1e-7f) { -// printf(" %4.4f: ", (double)f); -// ret = 0; -// } -// } - -// break; - -// default: -// errx(1, "<unknown / unsupported type %d>\n", 0 + param_type(param)); -// } - -// if (ret == 0) { -// printf("%c %s: equal\n", -// param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'), -// param_name(param)); -// } - -// exit(ret); -// } |