Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 2670 → Rev 2671

/trunk/main.c
69,7 → 69,7
 
void PrintLine(void)
{
printf("\n\r===================================");
printf("\r\n===================================");
}
 
 
100,7 → 100,7
#define MAX_CELL_VOLTAGE 43 // max cell voltage for LiPO
if(print)
{
printf("\n\rBatt:");
printf("\r\nBatt:");
LipoCells = 1 + UBat / MAX_CELL_VOLTAGE;
if(LipoCells > 6) LipoCells = 6;
}
364,7 → 364,7
if(PlatinenVersion < 20)
{
wdt_enable(WDTO_250MS); // Reset-Commando
while(1) printf("\n\rOld FC Hardware not supported by this Firmware!");
while(1) printf("\r\nOld FC Hardware not supported by this Firmware!");
}
#ifndef REDUNDANT_FC_SLAVE
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
379,7 → 379,7
timer = SetDelay(5);
while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer
}
printf("\n\rFound BL-Ctrl: ");
printf("\r\nFound BL-Ctrl: ");
// timer = SetDelay(1000);
for(i=0; i < MAX_MOTORS; i++)
{
402,7 → 402,7
if(vers && VersionInfo.BL_Firmware > vers) VersionInfo.BL_Firmware = vers;
//if(Motor[i].Version & MOTOR_STATE_FAST_MODE) printf("(fast)");
//if(Motor[i].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) printf("(new)");
//printf(":V%03d\n\r",vers);
//printf(":V%03d\r\n",vers);
}
}
for(i=0; i < MAX_MOTORS; i++)
409,7 → 409,7
{
if(!(Motor[i].State & MOTOR_STATE_PRESENT_MASK) && Mixer.Motor[i][0] > 0)
{
printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1);
printf("\r\n\r\n!! MISSING BL-CTRL: %d !!",i+1);
ServoActive = 2; // just in case the FC would be used as camera-stabilizer
}
Motor[i].State &= ~MOTOR_STATE_ERROR_MASK; // clear error counter
417,21 → 417,21
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
if(VersionInfo.BL_Firmware != 255)
{
printf("\n\rBL-Firmware %d.%02d",VersionInfo.BL_Firmware/100,VersionInfo.BL_Firmware%100);
printf("\r\nBL-Firmware %d.%02d",VersionInfo.BL_Firmware/100,VersionInfo.BL_Firmware%100);
if(VersionInfo.BL_Firmware >= 100 && VersionInfo.BL_Firmware <= 102) printf("<-- warning old Version!");
}
#endif
 
PrintLine();// ("\n\r===================================");
PrintLine();// ("\r\n===================================");
if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER;
if(RequiredMotors > 8) Max_I2C_Packets = 8; else Max_I2C_Packets = RequiredMotors;
#else
printf("\n\r\n\r--> REDUNDANT SLAVE <---\n\r");
printf("\r\n\r\n--> REDUNDANT SLAVE <---\r\n");
IamMaster = SLAVE;
#endif
 
#ifdef REDUNDANT_FC_MASTER
printf("\n\r\n\r--> REDUNDANT MASTER <---\n\r");
printf("\r\n\r\n--> REDUNDANT MASTER <---\r\n");
IamMaster = MASTER;
#endif
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
439,11 → 439,11
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)
{
printf("\n\rCalibrating pressure sensor..");
printf("\r\nCalibrating pressure sensor..");
timer = SetDelay(1000);
SucheLuftruckOffset();
while (!CheckDelay(timer));
printf("OK\n\r");
printf("OK\r\n");
}
 
#ifdef REDUNDANT_FC_SLAVE
465,19 → 465,19
FlugMinuten = 0;
FlugMinutenGesamt = 0;
}
printf("\n\rFlight-time %u min Total:%u min", FlugMinuten, FlugMinutenGesamt);
printf("\r\nFlight-time %u min Total:%u min", FlugMinuten, FlugMinutenGesamt);
LcdClear();
I2CTimeout = 5000;
WinkelOut.Orientation = 1;
LipoDetection(1);
LIBFC_ReceiverInit(EE_Parameter.Receiver);
PrintLine();// ("\n\r===================================");
PrintLine();// ("\r\n===================================");
//SpektrumBinding();
timer = SetDelay(2000);
timerPolling = SetDelay(250);
 
Debug(ANSI_CLEAR "FC-Start!\n\rFlugzeit: %d min", FlugMinutenGesamt); // Note: this won't waste flash memory, if #DEBUG is not active
if(PARAMSET_STRUCT_LEN != 179) while(1) printf("\n\rEE_Parameter size:%i", PARAMSET_STRUCT_LEN);
Debug(ANSI_CLEAR "FC-Start!\r\nFlugzeit: %d min", FlugMinutenGesamt); // Note: this won't waste flash memory, if #DEBUG is not active
if(PARAMSET_STRUCT_LEN != 179) while(1) printf("\r\nEE_Parameter size:%i", PARAMSET_STRUCT_LEN);
 
DebugOut.Status[0] = 0x01 | 0x02;
JetiBeep = 0;
487,7 → 487,7
#ifdef REDUNDANT_FC_SLAVE
timer = SetDelay(2500);
while(!CheckDelay(timer));
printf("\n\rStart\n\r");
printf("\r\nStart\r\n");
#endif
while(1)
{