diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-11-13 10:31:16 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-11-13 10:31:16 +0100 |
commit | d9989962a9ef06ce363082ed82c0ff2a647beabc (patch) | |
tree | c4f99bb3845118c07dfb705f0da95d5a850c097d /src/systemcmds/motor_test/motor_test.c | |
parent | df40637987e0434d7a03d9bc9e9803776cb81785 (diff) | |
parent | 7bc9a6257731a741ff309f060f6cf87c33c4a266 (diff) | |
download | px4-firmware-d9989962a9ef06ce363082ed82c0ff2a647beabc.tar.gz px4-firmware-d9989962a9ef06ce363082ed82c0ff2a647beabc.tar.bz2 px4-firmware-d9989962a9ef06ce363082ed82c0ff2a647beabc.zip |
Update motor test tool
Diffstat (limited to 'src/systemcmds/motor_test/motor_test.c')
-rw-r--r-- | src/systemcmds/motor_test/motor_test.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/systemcmds/motor_test/motor_test.c b/src/systemcmds/motor_test/motor_test.c index a73f46626..1b7ff75f7 100644 --- a/src/systemcmds/motor_test/motor_test.c +++ b/src/systemcmds/motor_test/motor_test.c @@ -79,8 +79,9 @@ void motor_test(unsigned channel, float value) static void usage(const char *reason) { - if (reason != NULL) + if (reason != NULL) { warnx("%s", reason); + } errx(1, "usage:\n" @@ -91,8 +92,9 @@ static void usage(const char *reason) int motor_test_main(int argc, char *argv[]) { - unsigned long channel, lval; - float value; + unsigned long channel = 0; + unsigned long lval; + float value = 0.0f; int ch; if (argc != 5) { @@ -123,7 +125,7 @@ int motor_test_main(int argc, char *argv[]) motor_test(channel, value); - printf("motor %d set to %.2f\n", channel, value); + printf("motor %d set to %.2f\n", channel, (double)value); exit(0); } |