Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2527 → Rev 2528

/trunk/capacity.c
107,8 → 107,8
SetSum = 0;
NumOfMotors = 0;
MinOfMaxPWM = 255;
if(Capacity.MinOfMaxPWM == 254) FC_StatusFlags3 |= FC_STATUS3_REDUNDANCE;
else if(Capacity.MinOfMaxPWM == 255) FC_StatusFlags3 &= ~FC_STATUS3_REDUNDANCE;
if(Capacity.MinOfMaxPWM == 254) FC_StatusFlags3 |= FC_STATUS3_REDUNDANCE_AKTIVE;
// else if(Capacity.MinOfMaxPWM == 255) FC_StatusFlags3 &= ~FC_STATUS3_REDUNDANCE_AKTIVE;
for(i = 0; i < MAX_MOTORS; i++)
{
121,7 → 121,9
}
else Current += (unsigned int)(Motor[i].Current);
SetSum += (unsigned int)(Motor[i].SetPoint);
if(Motor[i].MaxPWM <= MinOfMaxPWM) MinOfMaxPWM = Motor[i].MaxPWM; else FC_StatusFlags3 &= ~FC_STATUS3_REDUNDANCE;
if(Motor[i].MaxPWM <= MinOfMaxPWM) MinOfMaxPWM = Motor[i].MaxPWM;
else
if(Motor[i].MaxPWM == 255) FC_StatusFlags3 &= ~FC_STATUS3_REDUNDANCE_AKTIVE;
}
}
Capacity.MinOfMaxPWM = MinOfMaxPWM;
133,6 → 135,7
SumCurrentOffset += Current;
// after averaging set current to static offset
Current = FC_OFFSET_CURRENT;
FC_StatusFlags3 &= ~FC_STATUS3_REDUNDANCE_AKTIVE;
}
else // some motors are running, includes also motor test condition, where "MotorRunning" is false
{ // subtract offset