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
This commit is contained in:
Andrew Tridgell
2015-02-23 19:52:57 +01:00
committed by Lorenz Meier
parent 41cc04c064
commit 9a875c53af
+12
View File
@@ -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")) {