Rev 2390 | Rev 2404 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2390 | Rev 2402 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | unsigned int FlugSekunden = 0; |
58 | unsigned int FlugSekunden = 0; |
59 | pVoidFnct_pVoidFnctChar_const_fmt _printf_P; |
59 | pVoidFnct_pVoidFnctChar_const_fmt _printf_P; |
60 | unsigned char FoundMotors = 0; |
60 | unsigned char FoundMotors = 0; |
61 | unsigned char JetiBeep = 0; // to allow any Morse-Beeping of the Jeti-Box |
61 | unsigned char JetiBeep = 0; // to allow any Morse-Beeping of the Jeti-Box |
62 | unsigned char ActiveParamSet = 3; |
62 | unsigned char ActiveParamSet = 3; |
- | 63 | unsigned char LipoCells = 4; |
|
Line 63... | Line 64... | ||
63 | 64 | ||
64 | void PrintLine(void) |
65 | void PrintLine(void) |
65 | { |
66 | { |
66 | printf("\n\r==================================="); |
67 | printf("\n\r==================================="); |
Line 86... | Line 87... | ||
86 | 87 | ||
87 | 88 | ||
88 | void LipoDetection(unsigned char print) |
89 | void LipoDetection(unsigned char print) |
89 | { |
- | |
90 | #define MAX_CELL_VOLTAGE 43 // max cell volatage for LiPO |
90 | { |
91 | unsigned char cells; |
91 | #define MAX_CELL_VOLTAGE 43 // max cell volatage for LiPO |
92 | if(print) printf("\n\rBatt:"); |
92 | if(print) printf("\n\rBatt:"); |
93 | // timer = SetDelay(100); |
93 | // timer = SetDelay(100); |
94 | // if(print) while (!CheckDelay(timer)); |
94 | // if(print) while (!CheckDelay(timer)); |
95 | // up to 6s LiPo, less than 2s is technical impossible |
95 | // up to 6s LiPo, less than 2s is technical impossible |
96 | // for(cells = 2; cells < 7; cells++) if(UBat < cells * MAX_CELL_VOLTAGE) break; |
96 | // for(cells = 2; cells < 7; cells++) if(UBat < cells * MAX_CELL_VOLTAGE) break; |
97 | cells = 1 + UBat / MAX_CELL_VOLTAGE; |
97 | LipoCells = 1 + UBat / MAX_CELL_VOLTAGE; |
98 | if(EE_Parameter.UnterspannungsWarnung < 50) |
98 | if(EE_Parameter.UnterspannungsWarnung < 50) |
99 | { |
99 | { |
100 | BattLowVoltageWarning = cells * EE_Parameter.UnterspannungsWarnung; |
100 | BattLowVoltageWarning = LipoCells * EE_Parameter.UnterspannungsWarnung; |
101 | if(print) |
101 | if(print) |
102 | { |
102 | { |
103 | Piep(cells, 200); |
103 | Piep(LipoCells, 200); |
104 | printf(" %d Cells ", cells); |
104 | printf(" %d Cells ", LipoCells); |
105 | } |
105 | } |
Line 106... | Line 106... | ||
106 | } |
106 | } |
107 | else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung; |
107 | else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung; |
Line 108... | Line 108... | ||
108 | 108 | ||
Line 109... | Line 109... | ||
109 | // automatische Zellenerkennung |
109 | // automatische Zellenerkennung |
110 | if(EE_Parameter.AutoLandingVoltage < 50) EE_Parameter.AutoLandingVoltage = cells * EE_Parameter.AutoLandingVoltage; |
110 | if(EE_Parameter.AutoLandingVoltage < 50) EE_Parameter.AutoLandingVoltage = LipoCells * EE_Parameter.AutoLandingVoltage; |