Browse Source

fixed bug with telemetry/powermeter labels in CLI - wasn't synced with enum properly.

baro altitude telemetry fix.


git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@301 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop@gmail.com 12 years ago
parent
commit
880b7418fd
  1. 2
      src/cli.c
  2. 11
      src/mw.c
  3. 4
      src/telemetry.c

2
src/cli.c

@ -44,7 +44,7 @@ const char * const mixerNames[] = {
const char * const featureNames[] = {
"PPM", "VBAT", "INFLIGHT_ACC_CAL", "SPEKTRUM", "MOTOR_STOP",
"SERVO_TILT", "GYRO_SMOOTHING", "LED_RING", "GPS",
"FAILSAFE", "SONAR", "TELEMETRY", "VARIO",
"FAILSAFE", "SONAR", "TELEMETRY", "POWERMETER", "VARIO",
NULL
};

11
src/mw.c

@ -275,12 +275,13 @@ void loop(void)
uint8_t stTmp = 0;
uint8_t axis, i;
int16_t error, errorAngle;
int16_t delta, deltaSum;
int16_t PTerm, ITerm, PTermACC, ITermACC = 0, PTermGYRO = 0, ITermGYRO = 0, DTerm;
static int16_t lastGyro[3] = { 0, 0, 0 };
static int16_t delta1[3], delta2[3];
static int16_t errorGyroI[3] = { 0, 0, 0 };
static int16_t errorAngleI[2] = { 0, 0 };
int16_t delta;
static int16_t lastGyro[3] = { 0, 0, 0 };
static int16_t delta1[3], delta2[3];
int16_t deltaSum;
static uint32_t rcTime = 0;
static int16_t initialThrottleHold;
static uint32_t loopTime;
@ -697,7 +698,7 @@ void loop(void)
}
}
// **** PITCH & ROLL & YAW PID ****
// **** PITCH & ROLL & YAW PID ****
prop = max(abs(rcCommand[PITCH]), abs(rcCommand[ROLL])); // range [0;500]
for (axis = 0; axis < 3; axis++) {
if ((f.ANGLE_MODE || f.HORIZON_MODE) && axis < 2) { // MODE relying on ACC
@ -734,13 +735,11 @@ void loop(void)
}
PTerm -= (int32_t)gyroData[axis] * dynP8[axis] / 10 / 8; // 32 bits is needed for calculation
delta = gyroData[axis] - lastGyro[axis]; // 16 bits is ok here, the dif between 2 consecutive gyro reads is limited to 800
lastGyro[axis] = gyroData[axis];
deltaSum = delta1[axis] + delta2[axis] + delta;
delta2[axis] = delta1[axis];
delta1[axis] = delta;
DTerm = ((int32_t)deltaSum * dynD8[axis]) >> 5; // 32 bits is needed for calculation
axisPID[axis] = PTerm + ITerm - DTerm;
}

4
src/telemetry.c

@ -95,9 +95,9 @@ static void sendAccel(void)
static void sendBaro(void)
{
sendDataHead(ID_ALTITUDE_BP);
serialize16(EstAlt / 100);
serialize16(BaroAlt / 100);
sendDataHead(ID_ALTITUDE_AP);
serialize16(EstAlt % 100);
serialize16(BaroAlt % 100);
}
static void sendTemperature1(void)

Loading…
Cancel
Save