Subversion Repositories FlightCtrl

Rev

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

Rev 2389 Rev 2391
Line 79... Line 79...
79
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
79
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
80
// + extended Current measurement -> 200 = 20A    201 = 21A    255 = 75A (20+55)
80
// + extended Current measurement -> 200 = 20A    201 = 21A    255 = 75A (20+55)
81
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
81
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
82
unsigned int BL3_Current(unsigned char who) // in 0,1A
82
unsigned int BL3_Current(unsigned char who) // in 0,1A
83
{
83
{
-
 
84
 if(Motor[who].Current == 255) return(0); // invalid
84
 if(Motor[who].Current <= 200) return(Motor[who].Current);
85
 if(Motor[who].Current <= 200) return(Motor[who].Current);
85
 else
86
 else
86
 {
87
 {
87
  if(Motor[who].Version & MOTOR_STATE_BL30) return(200 + 10 * ((unsigned int)Motor[who].Current-200));
88
  if(Motor[who].Version & MOTOR_STATE_BL30) return(200 + 10 * ((unsigned int)Motor[who].Current-200));
88
  else return(Motor[who].Current);
89
  else return(Motor[who].Current);
Line 106... Line 107...
106
                SetSum = 0;
107
                SetSum = 0;
107
                NumOfMotors = 0;
108
                NumOfMotors = 0;
108
                MinOfMaxPWM = 255;
109
                MinOfMaxPWM = 255;
109
                for(i = 0; i < MAX_MOTORS; i++)
110
                for(i = 0; i < MAX_MOTORS; i++)
110
                {
111
                {
111
                        if(Motor[i].State & MOTOR_STATE_PRESENT_MASK)
112
                        if(Motor[i].State & MOTOR_STATE_PRESENT_MASK/* && Mixer.Motor[i][MIX_GAS]*/)
112
                        {
113
                        {
113
                                NumOfMotors++;
114
                                NumOfMotors++;
114
                                if(Motor[i].Current > 200)
115
                                if(Motor[i].Current > 200)
115
                                 {
116
                                 {
116
                                  Current += BL3_Current(i); // extended Current measurement -> 200 = 20A    201 = 21A    255 = 75A (20+55)
117
                                  Current += BL3_Current(i); // extended Current measurement -> 200 = 20A    201 = 21A    255 = 75A (20+55)