1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

implemented various things for cli

added 'reset to defaults' to cli
got rid of 'servo' feature since that's not really a feature a user can set
added couple more configurable tricopter things to config struct.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@118 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop 2012-03-17 14:09:14 +00:00
parent 2861482bb6
commit 2fc24b338e
8 changed files with 3048 additions and 2542 deletions

View file

@ -2,6 +2,7 @@
#include "mw.h"
static uint8_t numberMotor = 4;
uint8_t useServo = 0;
int16_t motor[8];
int16_t servo[8] = { 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500 };
@ -9,10 +10,10 @@ void mixerInit(void)
{
// enable servos for mixes that require them. note, this shifts motor counts.
if (cfg.mixerConfiguration == MULTITYPE_BI || cfg.mixerConfiguration == MULTITYPE_TRI || cfg.mixerConfiguration == MULTITYPE_GIMBAL || cfg.mixerConfiguration == MULTITYPE_FLYING_WING)
featureSet(FEATURE_SERVO);
useServo = 1;
// if we want camstab/trig, that also enabled servos. this is kinda lame. maybe rework feature bits later.
if (feature(FEATURE_SERVO_TILT) || feature(FEATURE_CAMTRIG))
featureSet(FEATURE_SERVO);
useServo = 1;
switch (cfg.mixerConfiguration) {
case MULTITYPE_GIMBAL:
@ -51,7 +52,7 @@ void mixerInit(void)
void writeServos(void)
{
if (!feature(FEATURE_SERVO))
if (!useServo)
return;
if (cfg.mixerConfiguration == MULTITYPE_TRI || cfg.mixerConfiguration == MULTITYPE_BI) {
@ -66,13 +67,15 @@ void writeServos(void)
}
}
extern uint8_t cliMode;
void writeMotors(void)
{
uint8_t i;
uint8_t offset = 0;
// when servos are enabled, motor outputs 1..2 are for servos only
if (feature(FEATURE_SERVO))
if (useServo)
offset = 2;
for (i = 0; i < numberMotor; i++)