39,26 → 39,57 |
void SucheLuftruckOffset(void) |
{ |
unsigned int off; |
off = GetParamByte(PID_PRESSURE_OFFSET); |
if(off > 20) off -= 10; |
OCR0A = off; |
ExpandBaro = 0; |
Delay_ms_Mess(100); |
if(MessLuftdruck < DESIRED_H_ADC) off = 0; |
for(; off < 250;off++) |
{ |
|
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
{ |
unsigned char off2; |
OCR0A = 150; |
off2 = GetParamByte(PID_PRESSURE_OFFSET); |
if(off2 < 230) off2 += 10; |
OCR0B = off2; |
Delay_ms_Mess(100); |
if(MessLuftdruck > DESIRED_H_ADC) off2 = 240; |
for(; off2 >= 5; off2 -= 5) |
{ |
OCR0B = off2; |
Delay_ms_Mess(50); |
printf("*"); |
if(MessLuftdruck > DESIRED_H_ADC) break; |
} |
SetParamByte(PID_PRESSURE_OFFSET, off2); |
if(off2 >= 15) off = 140; else off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms_Mess(50); |
printf("."); |
if(MessLuftdruck < DESIRED_H_ADC) break; |
} |
DruckOffsetSetting = off; |
} |
#else |
off = GetParamByte(PID_PRESSURE_OFFSET); |
if(off > 20) off -= 10; |
OCR0A = off; |
Delay_ms_Mess(50); |
printf("."); |
if(MessLuftdruck < DESIRED_H_ADC) break; |
} |
SetParamByte(PID_PRESSURE_OFFSET, off); |
DruckOffsetSetting = off; |
Delay_ms_Mess(100); |
if(MessLuftdruck < DESIRED_H_ADC) off = 0; |
for(; off < 250;off++) |
{ |
OCR0A = off; |
Delay_ms_Mess(50); |
printf("."); |
if(MessLuftdruck < DESIRED_H_ADC) break; |
} |
DruckOffsetSetting = off; |
SetParamByte(PID_PRESSURE_OFFSET, off); |
#endif |
if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) && (DruckOffsetSetting < 10 || DruckOffsetSetting >= 245)) VersionInfo.HardwareError[0] |= DEFEKT_PRESSURE; |
OCR0A = off; |
Delay_ms_Mess(300); |
} |
|
|
void SucheGyroOffset(void) |
{ |
unsigned char i, ready = 0; |