/trunk/capacity.c |
---|
70,6 → 70,7 |
Capacity.ActualCurrent = 0; |
Capacity.UsedCapacity = 0; |
Capacity.ActualPower = 0; |
Capacity.MinOfMaxPWM = 0; |
update_timer = SetDelay(CAPACITY_UPDATE_INTERVAL); |
} |
81,7 → 82,7 |
static unsigned short SubCounter = 0; |
static unsigned short CurrentOffset = 0; |
static unsigned long SumCurrentOffset = 0; |
unsigned char i, NumOfMotors; |
unsigned char i, NumOfMotors, MinOfMaxPWM; |
if(CheckDelay(update_timer)) |
{ |
90,6 → 91,7 |
Current = 0; |
SetSum = 0; |
NumOfMotors = 0; |
MinOfMaxPWM = 255; |
for(i = 0; i < MAX_MOTORS; i++) |
{ |
if(Motor[i].State & MOTOR_STATE_PRESENT_MASK) |
97,8 → 99,11 |
NumOfMotors++; |
Current += (unsigned int)(Motor[i].Current); |
SetSum += (unsigned int)(Motor[i].SetPoint); |
if(Motor[i].MaxPWM < MinOfMaxPWM) MinOfMaxPWM = Motor[i].MaxPWM; |
} |
} |
Capacity.MinOfMaxPWM = MinOfMaxPWM; |
if(SetSum == 0) // if all setpoints are 0 |
{ // determine offsets of motor currents |
#define CURRENT_AVERAGE 8 // 8bit = 256 * 10 ms = 2.56s average time |
/trunk/capacity.h |
---|
6,6 → 6,7 |
unsigned short ActualCurrent; // in 0.1A Steps |
unsigned short ActualPower; // in 0.1W |
unsigned short UsedCapacity; // in mAh |
unsigned char MinOfMaxPWM; // BL Power Limit |
} __attribute__((packed)) Capacity_t; |
extern Capacity_t Capacity; |
/trunk/fc.c |
---|
179,11 → 179,7 |
DebugOut.Analog[9] = UBat; |
DebugOut.Analog[10] = SenderOkay; |
DebugOut.Analog[11] = ErsatzKompass / GIER_GRAD_FAKTOR; |
//DebugOut.Analog[16] = NeutralAccZ; |
//DebugOut.Analog[16] = Motor[0].Temperature; |
//DebugOut.Analog[17] = FromNaviCtrl_Value.Distance; |
// DebugOut.Analog[18] = VarioMeter; |
// DebugOut.Analog[19] = WinkelOut.CalcState; |
DebugOut.Analog[16] = Capacity.MinOfMaxPWM; |
DebugOut.Analog[20] = ServoNickValue; |
DebugOut.Analog[22] = Capacity.ActualCurrent; |
DebugOut.Analog[23] = Capacity.UsedCapacity; |
/trunk/libfc1284.a |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/twimaster.c |
---|
266,7 → 266,7 |
else // old BL version |
{ |
pBuff = (uint8_t*)&(Motor[motor_read].Current); |
if(BLFlags & BLFLAG_READ_VERSION) BuffLen = 2; // Current & MaxPwm |
if((BLFlags & BLFLAG_READ_VERSION) || (motor_read == motor_read_temperature)) BuffLen = 2; // Current & MaxPwm |
else BuffLen = 1; // read Current only |
} |
if(BuffLen == 1) |
/trunk/uart.c |
---|
98,10 → 98,10 |
"Motor 2 ", |
"Motor 3 ", |
"Motor 4 ", //15 |
"BL Limit ", |
" ", |
" ", |
" ", |
" ", |
"Servo ", //20 |
"Hovergas ", |
"Current [0.1A] ", |