Subversion Repositories FlightCtrl

Rev

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

Rev 966 Rev 979
Line 40... Line 40...
40
      UpdateMotor = 1;
40
      UpdateMotor = 1;
41
    }
41
    }
42
    CountMilliseconds++;
42
    CountMilliseconds++;
43
    cnt_ms++;
43
    cnt_ms++;
44
    // update compass value if this option is enabled in the settings
44
    // update compass value if this option is enabled in the settings
-
 
45
#ifdef USE_COMPASS
45
    MM3_Update(); // read out mm3 board
46
    MM3_Update(); // read out mm3 board
-
 
47
#endif
46
  }  
48
  }  
Line 47... Line 49...
47
 
49
 
48
  if(beeptime > 1)
50
  if(beeptime > 1)
49
  {
51
  {
Line 144... Line 146...
144
//  Servo ansteuern
146
//  Servo ansteuern
145
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
147
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                
146
SIGNAL(SIG_OUTPUT_COMPARE2A)
148
SIGNAL(SIG_OUTPUT_COMPARE2A)
147
{
149
{
148
  static unsigned char timer = 10;
150
  static unsigned char timer = 10;
149
  unsigned char Parameter_ServoNickControl = 100;
-
 
150
 
-
 
151
  if(!timer--)  
151
  if(!timer--)  
152
  {
152
  {
153
    TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3;  
-
 
154
    ServoValue =  Parameter_ServoNickControl;
-
 
155
    if(EE_Parameter.ServoNickCompInvert & 0x01) ServoValue += ((long) EE_Parameter.ServoNickComp * (0)) / 512;
-
 
156
    else ServoValue -= ((long) EE_Parameter.ServoNickComp * (0)) / 512;
-
 
Line -... Line 153...
-
 
153
 
157
   
154
    TCCR2A=(1<<COM2A1)|(0<<COM2A0)|3;
-
 
155
    if(ServoValue < EE_Parameter.ServoNickMin)
-
 
156
    {
-
 
157
      ServoValue = EE_Parameter.ServoNickMin;
158
    if(ServoValue < EE_Parameter.ServoNickMin) ServoValue = EE_Parameter.ServoNickMin;
158
    }
-
 
159
    if(ServoValue > EE_Parameter.ServoNickMax)
-
 
160
    {
-
 
161
      ServoValue = EE_Parameter.ServoNickMax;
Line 159... Line 162...
159
    else if(ServoValue > EE_Parameter.ServoNickMax) ServoValue = EE_Parameter.ServoNickMax;
162
    }  
160
   
163
   
161
    OCR2A = ServoValue;// + 75;
164
    OCR2A = ServoValue;
162
    timer = EE_Parameter.ServoNickRefresh;
165
    timer = EE_Parameter.ServoNickRefresh;
163
  }
166
  }
164
  else
167
  else