Browse Source

motor_test: cleanup

sbg
Holger Steinhaus 10 years ago
parent
commit
a18460183c
  1. 2
      src/modules/uORB/topics/test_motor.h
  2. 9
      src/systemcmds/motor_test/motor_test.c

2
src/modules/uORB/topics/test_motor.h

@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
struct test_motor_s {
uint64_t timestamp; /**< output timestamp in us since system boot */
unsigned motor_number; /**< number of motor to spin */
float value; /**< output data, in natural output units */
float value; /**< output power, range [0..1]
};
/**

9
src/systemcmds/motor_test/motor_test.c

@ -55,6 +55,7 @@ @@ -55,6 +55,7 @@
__EXPORT int motor_test_main(int argc, char *argv[]);
static void motor_test(unsigned channel, float value);
static void usage(const char *reason);
@ -68,7 +69,7 @@ void motor_test(unsigned channel, float value) @@ -68,7 +69,7 @@ void motor_test(unsigned channel, float value)
_test_motor.value = value;
if (_test_motor_pub > 0) {
/* publish armed state */
/* publish test state */
orb_publish(ORB_ID(test_motor), _test_motor_pub, &_test_motor);
} else {
/* advertise and publish */
@ -102,18 +103,18 @@ int motor_test_main(int argc, char *argv[]) @@ -102,18 +103,18 @@ int motor_test_main(int argc, char *argv[])
switch (ch) {
case 'm':
/* Read in channels supplied as one int and convert to mask: 1234 -> 0xF */
/* Read in motor number */
channel = strtoul(optarg, NULL, 0);
break;
case 'p':
/* Read in custom low value */
/* Read in power value */
lval = strtoul(optarg, NULL, 0);
if (lval > 100)
usage("value invalid");
value = (float)lval/100.f;
value = ((float)lval)/100.f;
break;
default:
usage(NULL);

Loading…
Cancel
Save