Subversion Repositories FlightCtrl

Rev

Rev 2370 | Rev 2426 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2370 Rev 2416
Line 51... Line 51...
51
// + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de.
51
// + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de.
52
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
52
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Line 53... Line 53...
53
 
53
 
54
#include "main.h"
54
#include "main.h"
55
#include "eeprom.h"
55
#include "eeprom.h"
56
volatile int  Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 100;
56
volatile int  Aktuell_Nick,Aktuell_Roll,Aktuell_Gier,Aktuell_ax, Aktuell_ay,Aktuell_az, UBat = 150;
57
volatile int  AdWertNickFilter = 0, AdWertRollFilter = 0, AdWertGierFilter = 0;
57
volatile int  AdWertNickFilter = 0, AdWertRollFilter = 0, AdWertGierFilter = 0;
58
volatile int  HiResNick = 2500, HiResRoll = 2500;
58
volatile int  HiResNick = 2500, HiResRoll = 2500;
59
volatile int  AdWertNick = 0, AdWertRoll = 0, AdWertGier = 0;
59
volatile int  AdWertNick = 0, AdWertRoll = 0, AdWertGier = 0;
60
volatile int  AdWertAccRoll = 0,AdWertAccNick = 0,AdWertAccHoch = 0;
60
volatile int  AdWertAccRoll = 0,AdWertAccNick = 0,AdWertAccHoch = 0;
Line 225... Line 225...
225
        case 7:
225
        case 7:
226
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
226
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
227
            if(EE_Parameter.ExtraConfig & CFG_3_3V_REFERENCE) UBat = (3 * UBat + (11 * ADC) / 30) / 4; // there were some single FC2.1 with 3.3V reference
227
            if(EE_Parameter.ExtraConfig & CFG_3_3V_REFERENCE) UBat = (3 * UBat + (11 * ADC) / 30) / 4; // there were some single FC2.1 with 3.3V reference
228
                        else  
228
                        else  
229
#endif
229
#endif
-
 
230
                         {
-
 
231
                          static unsigned int tmpVoltage = 0;
-
 
232
                          if(!tmpVoltage) tmpVoltage = (10 * ADC);
-
 
233
                          if(tmpVoltage <= (10 * ADC)) tmpVoltage += 2; else tmpVoltage -= 2;
230
                        UBat = (3 * UBat + ADC / 3) / 4;
234
              UBat = tmpVoltage / 31;
-
 
235
                         }
231
                    kanal = AD_ACC_Z;
236
                    kanal = AD_ACC_Z;
232
            break;
237
            break;
233
       case 8:
238
       case 8:
234
                         Aktuell_az = ADC;
239
                         Aktuell_az = ADC;
235
                         AdWertAccHoch = Aktuell_az - NeutralAccZ - (int) NeutralAccZfine;
240
                         AdWertAccHoch = Aktuell_az - NeutralAccZ - (int) NeutralAccZfine;