Subversion Repositories FlightCtrl

Rev

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

Rev 1702 Rev 1726
Line 37... Line 37...
37
#define DESIRED_H_ADC 800
37
#define DESIRED_H_ADC 800
Line 38... Line 38...
38
 
38
 
39
void SucheLuftruckOffset(void)
39
void SucheLuftruckOffset(void)
40
{
40
{
41
 unsigned int off;
-
 
42
 off = GetParamByte(PID_PRESSURE_OFFSET);
-
 
43
 if(off > 20) off -= 10;
-
 
44
 OCR0A = off;
41
 unsigned int off;
-
 
42
 ExpandBaro = 0;
-
 
43
 
-
 
44
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
-
 
45
 {
-
 
46
  unsigned char off2;
-
 
47
  OCR0A = 150;
-
 
48
  off2 = GetParamByte(PID_PRESSURE_OFFSET);
-
 
49
  if(off2 < 230) off2 += 10;
45
 ExpandBaro = 0;
50
  OCR0B = off2;
46
 Delay_ms_Mess(100);
51
  Delay_ms_Mess(100);
-
 
52
  if(MessLuftdruck > DESIRED_H_ADC) off2 = 240;
-
 
53
  for(; off2 >= 5; off2 -= 5)
-
 
54
   {
-
 
55
   OCR0B = off2;
-
 
56
   Delay_ms_Mess(50);
-
 
57
   printf("*");
-
 
58
   if(MessLuftdruck > DESIRED_H_ADC) break;
-
 
59
   }
-
 
60
   SetParamByte(PID_PRESSURE_OFFSET, off2);
47
 if(MessLuftdruck < DESIRED_H_ADC) off = 0;
61
  if(off2 >= 15) off = 140; else off = 0;
48
 for(; off < 250;off++)
62
  for(; off < 250;off++)
-
 
63
   {
-
 
64
   OCR0A = off;
-
 
65
   Delay_ms_Mess(50);
-
 
66
   printf(".");
-
 
67
   if(MessLuftdruck < DESIRED_H_ADC) break;
-
 
68
   }
-
 
69
   DruckOffsetSetting = off;
-
 
70
 }
-
 
71
#else 
-
 
72
  off = GetParamByte(PID_PRESSURE_OFFSET);
49
  {
73
  if(off > 20) off -= 10;
-
 
74
  OCR0A = off;
-
 
75
  Delay_ms_Mess(100);
-
 
76
  if(MessLuftdruck < DESIRED_H_ADC) off = 0;
-
 
77
  for(; off < 250;off++)
-
 
78
   {
50
  OCR0A = off;
79
   OCR0A = off;
51
  Delay_ms_Mess(50);
80
   Delay_ms_Mess(50);
52
  printf(".");
81
   printf(".");
53
  if(MessLuftdruck < DESIRED_H_ADC) break;
82
   if(MessLuftdruck < DESIRED_H_ADC) break;
-
 
83
   }
54
  }
84
   DruckOffsetSetting = off;
55
 SetParamByte(PID_PRESSURE_OFFSET, off);
85
   SetParamByte(PID_PRESSURE_OFFSET, off);
56
 DruckOffsetSetting = off;
86
#endif
57
 if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) && (DruckOffsetSetting < 10 || DruckOffsetSetting >= 245)) VersionInfo.HardwareError[0] |= DEFEKT_PRESSURE;
87
 if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) && (DruckOffsetSetting < 10 || DruckOffsetSetting >= 245)) VersionInfo.HardwareError[0] |= DEFEKT_PRESSURE;
58
 OCR0A = off;
88
 OCR0A = off;
59
 Delay_ms_Mess(300);
89
 Delay_ms_Mess(300);
Line -... Line 90...
-
 
90
}
60
}
91
 
61
 
92
 
62
void SucheGyroOffset(void)
93
void SucheGyroOffset(void)
63
{
94
{
64
 unsigned char i, ready = 0;
95
 unsigned char i, ready = 0;