aboutsummaryrefslogtreecommitdiff
path: root/src/systemcmds
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-02-03 13:47:29 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-02-09 22:56:22 +0100
commitac155b0faca7e9c378e9059d318e1f5151c61561 (patch)
tree98767b56d567fddeded86199b8ad4e47b2fa12d5 /src/systemcmds
parent2f4d820063b7712a3acae8f5336439ebbd43fe80 (diff)
downloadpx4-firmware-ac155b0faca7e9c378e9059d318e1f5151c61561.tar.gz
px4-firmware-ac155b0faca7e9c378e9059d318e1f5151c61561.tar.bz2
px4-firmware-ac155b0faca7e9c378e9059d318e1f5151c61561.zip
System cmds: Move to 0 based index
Diffstat (limited to 'src/systemcmds')
-rw-r--r--src/systemcmds/esc_calib/esc_calib.c4
-rw-r--r--src/systemcmds/preflight_check/preflight_check.c12
-rw-r--r--src/systemcmds/pwm/pwm.c4
-rw-r--r--src/systemcmds/tests/test_adc.c2
-rw-r--r--src/systemcmds/tests/test_hrt.c4
-rw-r--r--src/systemcmds/tests/test_jig_voltages.c2
-rw-r--r--src/systemcmds/tests/test_led.c2
-rw-r--r--src/systemcmds/tests/test_ppm_loopback.c2
-rw-r--r--src/systemcmds/tests/test_servo.c2
9 files changed, 17 insertions, 17 deletions
diff --git a/src/systemcmds/esc_calib/esc_calib.c b/src/systemcmds/esc_calib/esc_calib.c
index 32682f890..aee26680c 100644
--- a/src/systemcmds/esc_calib/esc_calib.c
+++ b/src/systemcmds/esc_calib/esc_calib.c
@@ -81,7 +81,7 @@ usage(const char *reason)
errx(1,
"usage:\n"
"esc_calib\n"
- " [-d <device> PWM output device (defaults to " PWM_OUTPUT_DEVICE_PATH ")\n"
+ " [-d <device> PWM output device (defaults to " PWM_OUTPUT0_DEVICE_PATH ")\n"
" [-l <pwm> Low PWM value in us (default: %dus)\n"
" [-h <pwm> High PWM value in us (default: %dus)\n"
" [-c <channels>] Supply channels (e.g. 1234)\n"
@@ -93,7 +93,7 @@ usage(const char *reason)
int
esc_calib_main(int argc, char *argv[])
{
- char *dev = PWM_OUTPUT_DEVICE_PATH;
+ char *dev = PWM_OUTPUT0_DEVICE_PATH;
char *ep;
int ch;
int ret;
diff --git a/src/systemcmds/preflight_check/preflight_check.c b/src/systemcmds/preflight_check/preflight_check.c
index c5c959cf3..8c2a5ac7c 100644
--- a/src/systemcmds/preflight_check/preflight_check.c
+++ b/src/systemcmds/preflight_check/preflight_check.c
@@ -90,7 +90,7 @@ int preflight_check_main(int argc, char *argv[])
usleep(150000);
/* ---- MAG ---- */
- fd = open(MAG_DEVICE_PATH, 0);
+ fd = open(MAG0_DEVICE_PATH, 0);
if (fd < 0) {
warn("failed to open magnetometer - start with 'hmc5883 start' or 'lsm303d start'");
mavlink_log_critical(mavlink_fd, "SENSOR FAIL: NO MAG");
@@ -119,7 +119,7 @@ int preflight_check_main(int argc, char *argv[])
/* ---- ACCEL ---- */
close(fd);
- fd = open(ACCEL_DEVICE_PATH, O_RDONLY);
+ fd = open(ACCEL0_DEVICE_PATH, O_RDONLY);
devid = ioctl(fd, DEVIOCGDEVICEID,0);
param_get(param_find("CAL_ACC0_ID"), &(calibration_devid));
@@ -165,7 +165,7 @@ int preflight_check_main(int argc, char *argv[])
/* ---- GYRO ---- */
close(fd);
- fd = open(GYRO_DEVICE_PATH, 0);
+ fd = open(GYRO0_DEVICE_PATH, 0);
devid = ioctl(fd, DEVIOCGDEVICEID,0);
param_get(param_find("CAL_GYRO0_ID"), &(calibration_devid));
@@ -188,7 +188,7 @@ int preflight_check_main(int argc, char *argv[])
/* ---- BARO ---- */
close(fd);
- fd = open(BARO_DEVICE_PATH, 0);
+ fd = open(BARO0_DEVICE_PATH, 0);
close(fd);
/* ---- RC CALIBRATION ---- */
@@ -216,8 +216,8 @@ system_eval:
warnx("PREFLIGHT CHECK ERROR! TRIGGERING ALARM");
fflush(stderr);
- int buzzer = open(TONEALARM_DEVICE_PATH, O_WRONLY);
- int leds = open(LED_DEVICE_PATH, 0);
+ int buzzer = open(TONEALARM0_DEVICE_PATH, O_WRONLY);
+ int leds = open(LED0_DEVICE_PATH, 0);
if (leds < 0) {
close(buzzer);
diff --git a/src/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c
index eeba89fa8..0c984d69f 100644
--- a/src/systemcmds/pwm/pwm.c
+++ b/src/systemcmds/pwm/pwm.c
@@ -101,7 +101,7 @@ usage(const char *reason)
"info\t\t\t\tPrint information\n"
"\n"
"\t-v\t\t\tVerbose\n"
- "\t-d <dev>\t\t(default " PWM_OUTPUT_DEVICE_PATH ")\n"
+ "\t-d <dev>\t\t(default " PWM_OUTPUT0_DEVICE_PATH ")\n"
);
}
@@ -109,7 +109,7 @@ usage(const char *reason)
int
pwm_main(int argc, char *argv[])
{
- const char *dev = PWM_OUTPUT_DEVICE_PATH;
+ const char *dev = PWM_OUTPUT0_DEVICE_PATH;
unsigned alt_rate = 0;
uint32_t alt_channel_groups = 0;
bool alt_channels_set = false;
diff --git a/src/systemcmds/tests/test_adc.c b/src/systemcmds/tests/test_adc.c
index 03391b851..9f6905239 100644
--- a/src/systemcmds/tests/test_adc.c
+++ b/src/systemcmds/tests/test_adc.c
@@ -58,7 +58,7 @@
int test_adc(int argc, char *argv[])
{
- int fd = open(ADC_DEVICE_PATH, O_RDONLY);
+ int fd = open(ADC0_DEVICE_PATH, O_RDONLY);
if (fd < 0) {
warnx("ERROR: can't open ADC device");
diff --git a/src/systemcmds/tests/test_hrt.c b/src/systemcmds/tests/test_hrt.c
index 5690997a9..3ac99a5f6 100644
--- a/src/systemcmds/tests/test_hrt.c
+++ b/src/systemcmds/tests/test_hrt.c
@@ -124,10 +124,10 @@ int test_tone(int argc, char *argv[])
int fd, result;
unsigned long tone;
- fd = open(TONEALARM_DEVICE_PATH, O_WRONLY);
+ fd = open(TONEALARM0_DEVICE_PATH, O_WRONLY);
if (fd < 0) {
- printf("failed opening " TONEALARM_DEVICE_PATH "\n");
+ printf("failed opening " TONEALARM0_DEVICE_PATH "\n");
goto out;
}
diff --git a/src/systemcmds/tests/test_jig_voltages.c b/src/systemcmds/tests/test_jig_voltages.c
index 10c93b264..98a105cb3 100644
--- a/src/systemcmds/tests/test_jig_voltages.c
+++ b/src/systemcmds/tests/test_jig_voltages.c
@@ -90,7 +90,7 @@
int test_jig_voltages(int argc, char *argv[])
{
- int fd = open(ADC_DEVICE_PATH, O_RDONLY);
+ int fd = open(ADC0_DEVICE_PATH, O_RDONLY);
int ret = OK;
if (fd < 0) {
diff --git a/src/systemcmds/tests/test_led.c b/src/systemcmds/tests/test_led.c
index 6e3efc668..a8ee678b5 100644
--- a/src/systemcmds/tests/test_led.c
+++ b/src/systemcmds/tests/test_led.c
@@ -91,7 +91,7 @@ int test_led(int argc, char *argv[])
int fd;
int ret = 0;
- fd = open(LED_DEVICE_PATH, 0);
+ fd = open(LED0_DEVICE_PATH, 0);
if (fd < 0) {
printf("\tLED: open fail\n");
diff --git a/src/systemcmds/tests/test_ppm_loopback.c b/src/systemcmds/tests/test_ppm_loopback.c
index addd57bea..a753f45c2 100644
--- a/src/systemcmds/tests/test_ppm_loopback.c
+++ b/src/systemcmds/tests/test_ppm_loopback.c
@@ -67,7 +67,7 @@ int test_ppm_loopback(int argc, char *argv[])
int servo_fd, result;
servo_position_t pos;
- servo_fd = open(PWM_OUTPUT_DEVICE_PATH, O_RDWR);
+ servo_fd = open(PWM_OUTPUT0_DEVICE_PATH, O_RDWR);
if (servo_fd < 0) {
printf("failed opening /dev/pwm_servo\n");
diff --git a/src/systemcmds/tests/test_servo.c b/src/systemcmds/tests/test_servo.c
index 9c6951ca2..ba6848522 100644
--- a/src/systemcmds/tests/test_servo.c
+++ b/src/systemcmds/tests/test_servo.c
@@ -63,7 +63,7 @@ int test_servo(int argc, char *argv[])
servo_position_t data[PWM_OUTPUT_MAX_CHANNELS];
servo_position_t pos;
- fd = open(PWM_OUTPUT_DEVICE_PATH, O_RDWR);
+ fd = open(PWM_OUTPUT0_DEVICE_PATH, O_RDWR);
if (fd < 0) {
printf("failed opening /dev/pwm_servo\n");