mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 00:53:34 +08:00
Param: Be less verbose when nothing changes
This commit is contained in:
@@ -447,10 +447,7 @@ do_set(const char *name, const char *val, bool fail_on_not_found)
|
||||
char *end;
|
||||
int32_t newval = strtol(val, &end, 10);
|
||||
|
||||
if (i == newval) {
|
||||
printf("unchanged\n");
|
||||
|
||||
} else {
|
||||
if (i =!= newval) {
|
||||
printf("curr: %ld", (long)i);
|
||||
param_set(param, &newval);
|
||||
printf(" -> new: %ld\n", (long)newval);
|
||||
@@ -468,11 +465,8 @@ do_set(const char *name, const char *val, bool fail_on_not_found)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
|
||||
if (f == newval) {
|
||||
if (f != newval) {
|
||||
#pragma GCC diagnostic pop
|
||||
printf("unchanged\n");
|
||||
|
||||
} else {
|
||||
printf("curr: %4.4f", (double)f);
|
||||
param_set(param, &newval);
|
||||
printf(" -> new: %4.4f\n", (double)newval);
|
||||
|
||||
Reference in New Issue
Block a user