diff options
author | Andrew Tridgell <andrew@tridgell.net> | 2015-02-23 13:22:30 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-23 19:52:57 +0100 |
commit | 9a875c53af750e115529b1bb64269d2ded712c46 (patch) | |
tree | 22d52a8de6f0c2ffe2f6dbbf8cf7d456879cea18 | |
parent | 41cc04c06485f40c2219b8585d50138cd2e5fe37 (diff) | |
download | px4-firmware-9a875c53af750e115529b1bb64269d2ded712c46.tar.gz px4-firmware-9a875c53af750e115529b1bb64269d2ded712c46.tar.bz2 px4-firmware-9a875c53af750e115529b1bb64269d2ded712c46.zip |
px4fmu: added "mode_pwm4" startup mode
this is the default mode ArduPilot uses, and by setting it in the init
script we avoid any pin activity on the two GPIO pins during boot
-rw-r--r-- | src/drivers/px4fmu/fmu.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/drivers/px4fmu/fmu.cpp b/src/drivers/px4fmu/fmu.cpp index 3a9246bf2..8e7e93679 100644 --- a/src/drivers/px4fmu/fmu.cpp +++ b/src/drivers/px4fmu/fmu.cpp @@ -1529,6 +1529,7 @@ enum PortMode { PORT_GPIO_AND_SERIAL, PORT_PWM_AND_SERIAL, PORT_PWM_AND_GPIO, + PORT_PWM4, }; PortMode g_port_mode; @@ -1564,6 +1565,13 @@ fmu_new_mode(PortMode new_mode) #endif break; +#if defined(CONFIG_ARCH_BOARD_PX4FMU_V2) + case PORT_PWM4: + /* select 4-pin PWM mode */ + servo_mode = PX4FMU::MODE_4PWM; + break; +#endif + /* mixed modes supported on v1 board only */ #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1) @@ -1836,6 +1844,10 @@ fmu_main(int argc, char *argv[]) } else if (!strcmp(verb, "mode_pwm")) { new_mode = PORT_FULL_PWM; +#if defined(CONFIG_ARCH_BOARD_PX4FMU_V2) + } else if (!strcmp(verb, "mode_pwm4")) { + new_mode = PORT_PWM4; +#endif #if defined(CONFIG_ARCH_BOARD_PX4FMU_V1) } else if (!strcmp(verb, "mode_serial")) { |