added (untested) flag to disable tricopter servo updates when unarmed.
tri_unarmed_servo to 1 (default) always updates tri servo whether armed or not. tri_unarmed_servo to 0 will only send servo signal to tail servo when armed. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@392 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
509e349e69
commit
929bbc8c3f
|
@ -153,6 +153,7 @@ const clivalue_t valueTable[] = {
|
|||
{ "failsafe_throttle", VAR_UINT16, &cfg.failsafe_throttle, 1000, 2000 },
|
||||
{ "failsafe_detect_threshold", VAR_UINT16, &cfg.failsafe_detect_threshold, 100, 2000 },
|
||||
{ "yaw_direction", VAR_INT8, &cfg.yaw_direction, -1, 1 },
|
||||
{ "tri_unarmed_servo", VAR_INT8, &cfg.tri_unarmed_servo, 0, 1 },
|
||||
{ "tri_yaw_middle", VAR_UINT16, &cfg.tri_yaw_middle, 0, 2000 },
|
||||
{ "tri_yaw_min", VAR_UINT16, &cfg.tri_yaw_min, 0, 2000 },
|
||||
{ "tri_yaw_max", VAR_UINT16, &cfg.tri_yaw_max, 0, 2000 },
|
||||
|
|
|
@ -13,7 +13,7 @@ master_t mcfg; // master config struct with data independent from profiles
|
|||
config_t cfg; // profile config struct
|
||||
const char rcChannelLetters[] = "AERT1234";
|
||||
|
||||
static const uint8_t EEPROM_CONF_VERSION = 49;
|
||||
static const uint8_t EEPROM_CONF_VERSION = 50;
|
||||
static uint32_t enabledSensors = 0;
|
||||
static void resetConf(void);
|
||||
|
||||
|
@ -274,6 +274,7 @@ static void resetConf(void)
|
|||
|
||||
// servos
|
||||
cfg.yaw_direction = 1;
|
||||
cfg.tri_unarmed_servo = 1;
|
||||
cfg.tri_yaw_middle = 1500;
|
||||
cfg.tri_yaw_min = 1020;
|
||||
cfg.tri_yaw_max = 2000;
|
||||
|
|
|
@ -206,7 +206,16 @@ void writeServos(void)
|
|||
break;
|
||||
|
||||
case MULTITYPE_TRI:
|
||||
if (cfg.tri_unarmed_servo) {
|
||||
// if unarmed flag set, we always move servo
|
||||
pwmWriteServo(0, servo[5]);
|
||||
} else {
|
||||
// otherwise, only move servo when copter is armed
|
||||
if (f.ARMED)
|
||||
pwmWriteServo(0, servo[5]);
|
||||
else
|
||||
pwmWriteServo(0, 0); // kill servo signal completely.
|
||||
}
|
||||
break;
|
||||
|
||||
case MULTITYPE_AIRPLANE:
|
||||
|
|
1
src/mw.h
1
src/mw.h
|
@ -189,6 +189,7 @@ typedef struct config_t {
|
|||
|
||||
// mixer-related configuration
|
||||
int8_t yaw_direction;
|
||||
uint8_t tri_unarmed_servo; // send tail servo correction pulses even when unarmed
|
||||
uint16_t tri_yaw_middle; // tail servo center pos. - use this for initial trim
|
||||
uint16_t tri_yaw_min; // tail servo min
|
||||
uint16_t tri_yaw_max; // tail servo max
|
||||
|
|
Loading…
Reference in New Issue