diff options
author | px4dev <px4@purgatory.org> | 2012-11-04 16:44:36 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-11-04 16:44:36 -0800 |
commit | 7fbad5adea0a022d71d8c5c4453cda1244e154b3 (patch) | |
tree | 463d00314bf83283deb0fa7f0a42238aa071d5db | |
parent | 06e17eae5d6942e3d2c96f3e313707723b217b18 (diff) | |
download | px4-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.
-rw-r--r-- | apps/px4io/mixer.c | 2 | ||||
-rw-r--r-- | apps/px4io/px4io.c | 13 | ||||
-rw-r--r-- | apps/px4io/px4io.h | 12 |
3 files changed, 18 insertions, 9 deletions
diff --git a/apps/px4io/mixer.c b/apps/px4io/mixer.c index 94d10ef57..fab577383 100644 --- a/apps/px4io/mixer.c +++ b/apps/px4io/mixer.c @@ -96,7 +96,7 @@ struct mixer { } mixers[IO_SERVO_COUNT]; int -mixer_init(const char *mq_name) +mixer_init(void) { /* look for control data at 50Hz */ hrt_call_every(&mixer_input_call, 1000, 20000, mixer_tick, NULL); 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 */ diff --git a/apps/px4io/px4io.h b/apps/px4io/px4io.h index bbbe91865..7aef88102 100644 --- a/apps/px4io/px4io.h +++ b/apps/px4io/px4io.h @@ -53,6 +53,16 @@ #define IO_SERVO_COUNT 8 /* + * Debug logging + */ + +#if 1 +# define debug(fmt, ...) lib_lowprintf(fmt "\n", ##args) +#else +# define debug(fmt, ...) do {} while(0) +#endif + +/* * System state structure. */ struct sys_state_s @@ -130,7 +140,7 @@ extern volatile int timers[TIMER_NUM_TIMERS]; /* * Mixer */ -extern int mixer_init(const char *mq_name); +extern int mixer_init(void); /* * Safety switch/LED. |