Rev 2391 | Rev 2443 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2391 | Rev 2418 | ||
---|---|---|---|
Line 105... | Line 105... | ||
105 | // determine sum of all present BL currents and setpoints |
105 | // determine sum of all present BL currents and setpoints |
106 | Current = 0; |
106 | Current = 0; |
107 | SetSum = 0; |
107 | SetSum = 0; |
108 | NumOfMotors = 0; |
108 | NumOfMotors = 0; |
109 | MinOfMaxPWM = 255; |
109 | MinOfMaxPWM = 255; |
- | 110 | if(Capacity.MinOfMaxPWM == 254) RedundanceBlOperation = 1; |
|
- | 111 | else if(Capacity.MinOfMaxPWM == 255) RedundanceBlOperation = 0; |
|
- | 112 | ||
110 | for(i = 0; i < MAX_MOTORS; i++) |
113 | for(i = 0; i < MAX_MOTORS; i++) |
111 | { |
114 | { |
112 | if(Motor[i].State & MOTOR_STATE_PRESENT_MASK/* && Mixer.Motor[i][MIX_GAS]*/) |
115 | if(Motor[i].State & MOTOR_STATE_PRESENT_MASK/* && Mixer.Motor[i][MIX_GAS]*/) |
113 | { |
116 | { |
114 | NumOfMotors++; |
117 | NumOfMotors++; |
Line 116... | Line 119... | ||
116 | { |
119 | { |
117 | Current += BL3_Current(i); // extended Current measurement -> 200 = 20A 201 = 21A 255 = 75A (20+55) |
120 | Current += BL3_Current(i); // extended Current measurement -> 200 = 20A 201 = 21A 255 = 75A (20+55) |
118 | } |
121 | } |
119 | else Current += (unsigned int)(Motor[i].Current); |
122 | else Current += (unsigned int)(Motor[i].Current); |
120 | SetSum += (unsigned int)(Motor[i].SetPoint); |
123 | SetSum += (unsigned int)(Motor[i].SetPoint); |
121 | if(Motor[i].MaxPWM < MinOfMaxPWM) MinOfMaxPWM = Motor[i].MaxPWM; |
124 | if(Motor[i].MaxPWM <= MinOfMaxPWM) MinOfMaxPWM = Motor[i].MaxPWM; else RedundanceBlOperation = 0; |
122 | } |
125 | } |
123 | } |
126 | } |
124 | Capacity.MinOfMaxPWM = MinOfMaxPWM; |
127 | Capacity.MinOfMaxPWM = MinOfMaxPWM; |
Line 125... | Line 128... | ||
125 | 128 |