Subversion Repositories FlightCtrl

Rev

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

Rev 1211 Rev 1212
Line 88... Line 88...
88
int   GierGyroFehler = 0;
88
int   GierGyroFehler = 0;
89
char GyroFaktor,GyroFaktorGier;
89
char GyroFaktor,GyroFaktorGier;
90
char IntegralFaktor,IntegralFaktorGier;
90
char IntegralFaktor,IntegralFaktorGier;
91
int  DiffNick,DiffRoll;
91
int  DiffNick,DiffRoll;
92
int  Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0;
92
int  Poti1 = 0, Poti2 = 0, Poti3 = 0, Poti4 = 0;
93
volatile unsigned char Motor_Vorne,Motor_Hinten,Motor_Rechts,Motor_Links;
-
 
94
volatile unsigned char Motor1, Motor2,Motor3,Motor4,Motor5,Motor6,Motor7,Motor8;
-
 
95
volatile unsigned char SenderOkay = 0;
93
volatile unsigned char SenderOkay = 0;
96
int StickNick = 0,StickRoll = 0,StickGier = 0,StickGas = 0;
94
int StickNick = 0,StickRoll = 0,StickGier = 0,StickGas = 0;
97
char MotorenEin = 0;
95
char MotorenEin = 0;
98
int HoehenWert = 0;
96
int HoehenWert = 0;
99
int SollHoehe = 0;
97
int SollHoehe = 0;
Line 461... Line 459...
461
//############################################################################
459
//############################################################################
462
{
460
{
463
 unsigned char i;
461
 unsigned char i;
464
    if(!MotorenEin)
462
    if(!MotorenEin)
465
        {
463
        {
466
        for(i=0;i<MAX_MOTORS;i++) Motor[i] = 0;
464
         MikroKopterFlags &= ~(FLAG_MOTOR_RUN | FLAG_FLY);
467
#ifndef QUADRO
465
                 for(i=0;i<MAX_MOTORS;i++)
468
                Motor1 = 0;Motor2 = 0;Motor3 = 0;Motor4 = 0;Motor5 = 0;Motor6 = 0;Motor7 = 0;Motor8 = 0;
-
 
469
        if(MotorTest[0]) {Motor1 = MotorTest[0]; Motor2 = MotorTest[0];}
-
 
470
        if(MotorTest[3]) {Motor3 = MotorTest[3]; Motor4 = MotorTest[3];}
-
 
471
        if(MotorTest[1]) {Motor5 = MotorTest[1]; Motor6 = MotorTest[1];}
-
 
472
        if(MotorTest[2]) {Motor7 = MotorTest[2]; Motor8 = MotorTest[2];}
-
 
473
#else 
466
                  {
474
        Motor_Hinten = 0; Motor_Vorne = 0; Motor_Rechts = 0; Motor_Links = 0;
-
 
475
        if(MotorTest[0]) Motor_Vorne = MotorTest[0];
-
 
476
        if(MotorTest[1]) Motor_Hinten = MotorTest[1];
467
                   if(!PC_MotortestActive)  MotorTest[i] = 0;
477
        if(MotorTest[2]) Motor_Links = MotorTest[2];
468
                   Motor[i] = MotorTest[i];
478
        if(MotorTest[3]) Motor_Rechts = MotorTest[3];
-
 
479
#endif
469
                  }
480
        if(MotorTest[0]) Motor[0] = MotorTest[0];
-
 
481
        if(MotorTest[1]) Motor[1] = MotorTest[1];
-
 
482
        if(MotorTest[2]) Motor[2] = MotorTest[2];
470
          if(PC_MotortestActive) PC_MotortestActive--;
483
        if(MotorTest[3]) Motor[3] = MotorTest[3];
471
        }
484
 
-
 
485
        MikroKopterFlags &= ~(FLAG_MOTOR_RUN | FLAG_FLY);
-
 
486
        } else MikroKopterFlags |= FLAG_MOTOR_RUN;
472
        else MikroKopterFlags |= FLAG_MOTOR_RUN;
487
 
473
 
488
    DebugOut.Analog[12] = Motor_Vorne;
474
    DebugOut.Analog[12] = Motor[0];
489
    DebugOut.Analog[13] = Motor_Hinten;
475
    DebugOut.Analog[13] = Motor[1];
490
    DebugOut.Analog[14] = Motor_Links;
476
    DebugOut.Analog[14] = Motor[3];
491
    DebugOut.Analog[15] = Motor_Rechts;
477
    DebugOut.Analog[15] = Motor[2];
Line 492... Line 478...
492
 
478
 
493
    //Start I2C Interrupt Mode
479
    //Start I2C Interrupt Mode
494
    twi_state = 0;
480
    twi_state = 0;
495
    motor = 0;
481
    motor = 0;