Browse Source

Enable flaps, avoid mode switch position

sbg
Lorenz Meier 10 years ago
parent
commit
f490331632
  1. 2
      src/drivers/px4io/px4io.cpp
  2. 9
      src/modules/px4iofirmware/controls.c
  3. 7
      src/modules/px4iofirmware/mixer.cpp
  4. 1
      src/modules/px4iofirmware/protocol.h
  5. 3
      src/modules/px4iofirmware/registers.c

2
src/drivers/px4io/px4io.cpp

@ -1274,7 +1274,7 @@ PX4IO::io_set_rc_config() @@ -1274,7 +1274,7 @@ PX4IO::io_set_rc_config()
if ((ichan >= 0) && (ichan < (int)_max_rc_input)) {
/* use out of normal bounds index to indicate special channel */
input_map[ichan - 1] = 8;
input_map[ichan - 1] = PX4IO_P_RC_CONFIG_ASSIGNMENT_MODESWITCH;
}
/*

9
src/modules/px4iofirmware/controls.c

@ -315,15 +315,12 @@ controls_tick() { @@ -315,15 +315,12 @@ controls_tick() {
}
}
/* pick out override channel, indicated by mapping 8 (9 th channel, virtual) */
if (mapped == 8) {
rc_value_override = SIGNED_TO_REG(scaled);
} else {
/* normal channel */
r_rc_values[mapped] = SIGNED_TO_REG(scaled);
assigned_channels |= (1 << mapped);
}
} else if (mapped == PX4IO_P_RC_CONFIG_ASSIGNMENT_MODESWITCH) {
/* pick out override channel, indicated by special mapping */
rc_value_override = SIGNED_TO_REG(scaled);
}
}
}

7
src/modules/px4iofirmware/mixer.cpp

@ -60,13 +60,6 @@ extern "C" { @@ -60,13 +60,6 @@ extern "C" {
*/
#define FMU_INPUT_DROP_LIMIT_US 500000
/* XXX need to move the RC_CHANNEL_FUNCTION out of rc_channels.h and into systemlib */
#define ROLL 0
#define PITCH 1
#define YAW 2
#define THROTTLE 3
#define OVERRIDE 4
/* current servo arm/disarm state */
static bool mixer_servos_armed = false;
static bool should_arm = false;

1
src/modules/px4iofirmware/protocol.h

@ -246,6 +246,7 @@ enum { /* DSM bind states */ @@ -246,6 +246,7 @@ enum { /* DSM bind states */
#define PX4IO_P_RC_CONFIG_MAX 2 /**< highest input value */
#define PX4IO_P_RC_CONFIG_DEADZONE 3 /**< band around center that is ignored */
#define PX4IO_P_RC_CONFIG_ASSIGNMENT 4 /**< mapped input value */
#define PX4IO_P_RC_CONFIG_ASSIGNMENT_MODESWITCH 100 /**< magic value for mode switch */
#define PX4IO_P_RC_CONFIG_OPTIONS 5 /**< channel options bitmask */
#define PX4IO_P_RC_CONFIG_OPTIONS_ENABLED (1 << 0)
#define PX4IO_P_RC_CONFIG_OPTIONS_REVERSE (1 << 1)

3
src/modules/px4iofirmware/registers.c

@ -686,7 +686,8 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value) @@ -686,7 +686,8 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
if (conf[PX4IO_P_RC_CONFIG_ASSIGNMENT] == UINT8_MAX) {
disabled = true;
} else if (conf[PX4IO_P_RC_CONFIG_ASSIGNMENT] >= PX4IO_RC_MAPPED_CONTROL_CHANNELS) {
} else if ((conf[PX4IO_P_RC_CONFIG_ASSIGNMENT] >= PX4IO_RC_MAPPED_CONTROL_CHANNELS) &&
(conf[PX4IO_P_RC_CONFIG_ASSIGNMENT] != PX4IO_P_RC_CONFIG_ASSIGNMENT_MODESWITCH)) {
count++;
}

Loading…
Cancel
Save