1374,7 → 1374,7 |
YawGyroDrift += error; |
if(UpdateCompassCourse) |
{ |
BeepTime = 200; |
//BeepTime = 200; |
YawGyroHeading = (int32_t)CompassHeading * GYRO_DEG_FACTOR; |
CompassCourse = (int16_t)(YawGyroHeading / GYRO_DEG_FACTOR); |
UpdateCompassCourse = 0; |
1444,7 → 1444,7 |
DebugOut.Analog[11] = YawGyroHeading / GYRO_DEG_FACTOR; |
DebugOut.Analog[19] = CompassCalState; |
DebugOut.Analog[20] = ServoNickValue; |
DebugOut.Analog[29] = NCSerialDataOkay; |
//DebugOut.Analog[29] = NCSerialDataOkay; |
DebugOut.Analog[30] = GPSStickNick; |
DebugOut.Analog[31] = GPSStickRoll; |
} |
1523,8 → 1523,9 |
|
#define BARO_LIMIT_MAX 0x01 |
#define BARO_LIMIT_MIN 0x02 |
#define BARO_EXPAND_TIME 350 // 350 * 2ms = 0.7s |
static uint8_t BaroFlags = 0; |
static uint8_t BaroExpandActive = 0; |
static uint16_t BaroExpandActive = 0; |
|
// get the current hooverpoint |
DebugOut.Analog[21] = HooverGas; |
1548,7 → 1549,7 |
ExpandBaro -= 1; |
OCR0A = PressureSensorOffset - EXPANDBARO_OPA_OFFSET_STEP * ExpandBaro; // increase offset to shift ADC down |
BeepTime = 300; |
BaroExpandActive = 250; |
BaroExpandActive = BARO_EXPAND_TIME; |
} |
else |
{ |
1563,7 → 1564,7 |
ExpandBaro += 1; |
OCR0A = PressureSensorOffset - EXPANDBARO_OPA_OFFSET_STEP * ExpandBaro; // decrease offset to shift ADC up |
BeepTime = 300; |
BaroExpandActive = 250; |
BaroExpandActive = BARO_EXPAND_TIME; |
} |
else |
{ |
1659,9 → 1660,9 |
} |
else // gas stick in hoover range |
{ |
if(HeightTrimmingFlag & (HC_TRIM_UP|HC_TRIM_DOWN)) |
if(HeightTrimmingFlag & (HC_TRIM_UP | HC_TRIM_DOWN)) |
{ |
HeightTrimmingFlag &= ~(HC_TRIM_UP|HC_TRIM_DOWN); |
HeightTrimmingFlag &= ~(HC_TRIM_UP | HC_TRIM_DOWN); |
HeightTrimming = 0; |
SetPointHeight = ReadingHeight; // update setpoint to current height |
if(ParamSet.Config2 & CFG2_VARIO_BEEP) BeepTime = 500; |
1681,6 → 1682,7 |
LIMIT_MIN_MAX(StickGasHoover, 70, 150); // reserve some range for trim up and down |
} |
} // EOF trimming height set point |
if(BaroExpandActive) SetPointHeight = ReadingHeight; // update setpoint to current altitude if expanding is active |
} //if MKFlags & MKFLAG_FLY |
else // not flying but height control is already active |
{ |