aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/px4io.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-11-04 16:44:36 -0800
committerpx4dev <px4@purgatory.org>2012-11-04 16:44:36 -0800
commit7fbad5adea0a022d71d8c5c4453cda1244e154b3 (patch)
tree463d00314bf83283deb0fa7f0a42238aa071d5db /apps/px4io/px4io.c
parent06e17eae5d6942e3d2c96f3e313707723b217b18 (diff)
downloadpx4-firmware-7fbad5adea0a022d71d8c5c4453cda1244e154b3.tar.gz
px4-firmware-7fbad5adea0a022d71d8c5c4453cda1244e154b3.tar.bz2
px4-firmware-7fbad5adea0a022d71d8c5c4453cda1244e154b3.zip
Fix PWM channel zero output; pin configuration was being overwritten by USART2 setup.
Diffstat (limited to 'apps/px4io/px4io.c')
-rw-r--r--apps/px4io/px4io.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/px4io/px4io.c b/apps/px4io/px4io.c
index 90057c790..dc8e227fc 100644
--- a/apps/px4io/px4io.c
+++ b/apps/px4io/px4io.c
@@ -59,8 +59,6 @@ int gpio_fd;
static const char cursor[] = {'|', '/', '-', '\\'};
-static const char *rc_input_mq_name = "rc_input";
-
static struct hrt_call timer_tick_call;
volatile int timers[TIMER_NUM_TIMERS];
static void timer_tick(void *arg);
@@ -74,7 +72,11 @@ int user_start(int argc, char *argv[])
/* configure the high-resolution time/callout interface */
hrt_init();
- /* configure the PWM outputs */
+ /* init the FMU link */
+ comms_init();
+
+ /* configure the first 8 PWM outputs (i.e. all of them) */
+ /* note, must do this after comms init to steal back PA0, which is CTS otherwise */
up_pwm_servo_init(0xff);
/* print some startup info */
@@ -94,14 +96,11 @@ int user_start(int argc, char *argv[])
POWER_SERVO(true);
/* start the mixer */
- mixer_init(rc_input_mq_name);
+ mixer_init();
/* start the safety switch handler */
safety_init();
- /* init the FMU link */
- comms_init();
-
/* set up some timers for the main loop */
timers[TIMER_BLINK_AMBER] = 250; /* heartbeat blink @ 2Hz */
timers[TIMER_STATUS_PRINT] = 1000; /* print status message @ 1Hz */