Subversion Repositories FlightCtrl

Rev

Rev 1219 | Rev 1253 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1219 Rev 1246
Line 17... Line 17...
17
volatile unsigned int  MessLuftdruck = 1023;
17
volatile unsigned int  MessLuftdruck = 1023;
18
unsigned char DruckOffsetSetting;
18
unsigned char DruckOffsetSetting;
19
signed char ExpandBaro = 0;
19
signed char ExpandBaro = 0;
20
volatile int HoeheD = 0;
20
volatile int HoeheD = 0;
21
volatile char messanzahl_Druck;
21
volatile char messanzahl_Druck;
22
volatile int  tmpLuftdruck;
22
volatile long tmpLuftdruck;
23
volatile unsigned int ZaehlMessungen = 0;
23
volatile unsigned int ZaehlMessungen = 0;
24
unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115;
24
unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115;
25
unsigned char GyroDefektN = 0,GyroDefektR = 0,GyroDefektG = 0;
25
unsigned char GyroDefektN = 0,GyroDefektR = 0,GyroDefektG = 0;
26
volatile unsigned char AdReady = 1;
26
volatile unsigned char AdReady = 1;
27
//#######################################################################################
27
//#######################################################################################
Line 221... Line 221...
221
            // "break" fehlt hier absichtlich
221
            // "break" fehlt hier absichtlich
222
        case 9:
222
        case 9:
223
            tmpLuftdruck += ADC;
223
            tmpLuftdruck += ADC;
224
            if(++messanzahl_Druck >= 5)
224
            if(++messanzahl_Druck >= 5)
225
                {
225
                {
-
 
226
                                tmpLuftdruck -= 2616L * ExpandBaro; // -523.19 counts per 10 counts offset step
226
                                tmpLuftdruck /= 2;
227
                                tmpLuftdruck /= 2;
227
                MessLuftdruck = ADC;
228
                MessLuftdruck = ADC;
228
                messanzahl_Druck = 0;
229
                messanzahl_Druck = 0;
229
                                HoeheD = (31 * HoeheD + (int) Parameter_Luftdruck_D * (int)(255 * ExpandBaro + StartLuftdruck - tmpLuftdruck - HoehenWert))/32;  // D-Anteil = neuerWert - AlterWert
230
                                HoeheD = (31 * HoeheD + (int) Parameter_Luftdruck_D * (int)((int)(StartLuftdruck - tmpLuftdruck) - HoehenWert))/32;  // D-Anteil = neuerWert - AlterWert
230
                Luftdruck = (tmpLuftdruck + 7 * Luftdruck + 4) / 8;
231
                Luftdruck = (tmpLuftdruck + 7 * Luftdruck + 4) / 8;
231
                HoehenWert = 255 * ExpandBaro + StartLuftdruck - Luftdruck;
232
                HoehenWert = StartLuftdruck - Luftdruck;
232
                tmpLuftdruck /= 2;
233
                tmpLuftdruck /= 2;
233
                }
234
                }
234
            kanal = AD_NICK;
235
            kanal = AD_NICK;
235
            break;
236
            break;
236
        default:  
237
        default: