Skip to content

Commit

Permalink
- use alt.EstAlt instead of BaroAlt
Browse files Browse the repository at this point in the history
git-svn-id: http://multiwii.googlecode.com/svn/trunk/MultiWii_shared@1567 02679b44-d973-9852-f2fa-63770883b36c
  • Loading branch information
[email protected] committed Sep 10, 2013
1 parent d585901 commit 396af92
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Alarms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,14 +649,14 @@ void vario_signaling(void) {
static uint16_t t = 0;
if (!(t++ % ALTITUDE_INTERVAL)) {
static int32_t last_BaroAlt = 0;
int32_t delta_BaroAlt = BaroAlt - last_BaroAlt;
int32_t delta_BaroAlt = alt.EstAlt - last_BaroAlt;
if (abs(delta_BaroAlt) > DELTA_ALT_TRESHOLD) {
// inject suitable values
max_v = abs(delta_BaroAlt / DELTA_T);
max_up = (delta_BaroAlt > 0 ? 1 : 0);
silence = 0;
}
last_BaroAlt = BaroAlt;
last_BaroAlt = alt.EstAlt;
}
}
#endif // end method 2
Expand Down
1 change: 1 addition & 0 deletions IMU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ void getEstimatedAttitude(){

#if BARO
uint8_t getEstimatedAltitude(){
int32_t BaroAlt;
static int32_t baroGroundPressure;
static float vel = 0.0f;
static uint16_t previousT;
Expand Down
2 changes: 1 addition & 1 deletion LCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,7 @@ void lcd_telemetry() {
case 6:// height
#if BARO
{
int16_t h = BaroAlt / 100;
int16_t h = alt.EstAlt / 100;
LCDprint('A'); LCDprintInt16(h); LCDprint('m');
h = BAROaltMax / 100;
LCDprintChar(" ("); LCDprintInt16(h);
Expand Down
8 changes: 4 additions & 4 deletions MultiWii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ uint16_t calibratingG;
int16_t magHold,headFreeModeHold; // [-180;+180]
uint8_t vbatMin = VBATNOMINAL; // lowest battery voltage in 0.1V steps
uint8_t rcOptions[CHECKBOXITEMS];
int32_t BaroAlt,AltHold; // in cm
int32_t AltHold; // in cm
int16_t sonarAlt;
int16_t BaroPID = 0;
int16_t errorAltitudeI = 0;
Expand Down Expand Up @@ -186,7 +186,7 @@ flags_struct_t f;
uint16_t cycleTimeMax = 0; // highest ever cycle timen
uint16_t cycleTimeMin = 65535; // lowest ever cycle timen
int32_t BAROaltMax; // maximum value
uint16_t GPS_speedMax = 0; // maximum speed from gps
uint16_t GPS_speedMax = 0; // maximum speed from gps
uint16_t powerValueMaxMAH = 0;
#endif
#if defined(LOG_VALUES) || defined(LCD_TELEMETRY) || defined(ARMEDTIMEWARNING) || defined(LOG_PERMANENT)
Expand Down Expand Up @@ -547,7 +547,7 @@ void annexCode() { // this code is excetuted at each loop and won't interfere wi
#endif
#ifdef LCD_TELEMETRY
#if BARO
if ( (BaroAlt > BAROaltMax) ) BAROaltMax = BaroAlt;
if ( (alt.EstAlt > BAROaltMax) ) BAROaltMax = alt.EstAlt;
#endif
#if GPS
if ( (GPS_speed > GPS_speedMax) ) GPS_speedMax = GPS_speed;
Expand Down Expand Up @@ -710,7 +710,7 @@ void go_arm() {
#endif
#ifdef LCD_TELEMETRY // reset some values when arming
#if BARO
BAROaltMax = BaroAlt;
BAROaltMax = alt.EstAlt;
#endif
#if GPS
GPS_speedMax = 0;
Expand Down
2 changes: 1 addition & 1 deletion MultiWii.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern uint16_t calibratingG;
extern int16_t magHold,headFreeModeHold;
extern uint8_t vbatMin;
extern uint8_t rcOptions[CHECKBOXITEMS];
extern int32_t BaroAlt,AltHold;
extern int32_t AltHold;
extern int16_t sonarAlt;
extern int16_t BaroPID;
extern int16_t errorAltitudeI;
Expand Down

0 comments on commit 396af92

Please sign in to comment.