Browse Source

Copter: support all 12 channels on PX4

last 4 channels are on the FMU pins
mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
300a8d2bbc
  1. 4
      ArduCopter/ArduCopter.pde
  2. 15
      ArduCopter/Parameters.h
  3. 9
      ArduCopter/Parameters.pde
  4. 4
      ArduCopter/radio.pde

4
ArduCopter/ArduCopter.pde

@ -1235,7 +1235,9 @@ static void slow_loop() @@ -1235,7 +1235,9 @@ static void slow_loop()
case 1:
slow_loopCounter++;
#if MOUNT == ENABLED
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8, &g.rc_9, &g.rc_10, &g.rc_11, &g.rc_12);
#elif MOUNT == ENABLED
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8, &g.rc_10, &g.rc_11);
#endif
enable_aux_servos();

15
ArduCopter/Parameters.h

@ -194,6 +194,8 @@ public: @@ -194,6 +194,8 @@ public:
k_param_failsafe_battery_enabled,
k_param_throttle_mid,
k_param_failsafe_gps_enabled, // 195
k_param_rc_9,
k_param_rc_12,
//
// 200: flight modes
@ -356,6 +358,12 @@ public: @@ -356,6 +358,12 @@ public:
RC_Channel_aux rc_10;
RC_Channel_aux rc_11;
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
RC_Channel_aux rc_9;
RC_Channel_aux rc_12;
#endif
AP_Int16 rc_speed; // speed of fast RC Channels in Hz
// Acro parameters
@ -402,7 +410,12 @@ public: @@ -402,7 +410,12 @@ public:
rc_6 (CH_6),
rc_7 (CH_7),
rc_8 (CH_8),
#if MOUNT == ENABLED
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
rc_9 (CH_9),
rc_10 (CH_10),
rc_11 (CH_11),
rc_12 (CH_12),
#elif MOUNT == ENABLED
rc_10 (CH_10),
rc_11 (CH_11),
#endif

9
ArduCopter/Parameters.pde

@ -455,6 +455,15 @@ const AP_Param::Info var_info[] PROGMEM = { @@ -455,6 +455,15 @@ const AP_Param::Info var_info[] PROGMEM = {
GGROUP(rc_11, "RC11_", RC_Channel_aux),
#endif
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
// @Group: RC9_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_9, "RC9_", RC_Channel_aux),
// @Group: RC12_
// @Path: ../libraries/RC_Channel/RC_Channel.cpp,../libraries/RC_Channel/RC_Channel_aux.cpp
GGROUP(rc_12, "RC12_", RC_Channel_aux),
#endif
// @Param: RC_SPEED
// @DisplayName: ESC Update Speed
// @Description: This is the speed in Hertz that your ESCs will receive updates

4
ArduCopter/radio.pde

@ -54,7 +54,9 @@ static void init_rc_in() @@ -54,7 +54,9 @@ static void init_rc_in()
g.rc_7.set_range(0,1000);
g.rc_8.set_range(0,1000);
#if MOUNT == ENABLED
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8, &g.rc_9, &g.rc_10, &g.rc_11, &g.rc_12);
#elif MOUNT == ENABLED
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8, &g.rc_10, &g.rc_11);
#endif
}

Loading…
Cancel
Save