359,10 → 359,10 |
newErrorCode = 23; |
DebugOut.StatusRed |= AMPEL_BL; |
} |
else if(BL_MinOfMaxPWM < 30 && !ErrorCode) |
else if(BL_MinOfMaxPWM && BL_MinOfMaxPWM < 30 && !ErrorCode) |
{ |
u16 i; |
for(i = 0; i < 12; i++) if(Motor[i].MaxPWM == BL_MinOfMaxPWM) break; |
for(i = 0; i < 16; i++) if(Motor[i].MaxPWM == BL_MinOfMaxPWM) break; // find the motor number |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR:BL%2d Test:%2d ",i+1,BL_MinOfMaxPWM); |
newErrorCode = 32; |
579,7 → 579,8 |
NaviData.FlyingTime++; // we want to count the battery-time |
TimeSinceMotorStart++; |
} |
|
|
if(EE_Parameter.Revision == 0) RequestConfigFromFC = 1; |
if(SerialLinkOkay) SerialLinkOkay--; |
if(SerialLinkOkay < 250 - 6) NCFlags |= NC_FLAG_NOSERIALLINK; // 6 seconds timeout for serial communication |
else NCFlags &= ~NC_FLAG_NOSERIALLINK; |
669,7 → 670,6 |
DebugOut.StatusRed = 0x00; |
UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
Compass_Init(); |
|
#ifdef FOLLOW_ME |
TransmitAlsoToFC = 1; |
UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
687,6 → 687,14 |
if(IamMaster == SLAVE) UART1_PutString(" SLAVE\r\n"); |
if(IamMaster == MASTER) UART1_PutString(" MASTER\r\n"); |
|
// +++++++++++++++++++++++++++++++++++++++ |
// ++ check CamCtrl version (if connected) |
if(Compass_I2CPort == NCMAG_PORT_INTERN) |
{ |
if(I2CBus_LockBuffer(I2C0,3)) I2CBus_Transmission(I2C0, CAM_SLAVE_ADDRESS, &ToCamCtrl, 4, &CamCtrl_UpdateData, sizeof(FromCamCtrl)); |
} |
else CamCtrlTimeout = 0; // disable CamCtrl communication if external compass is connected |
// +++++++++++++++++++++++++++++++++++++++ |
if(UBX_Setup() == 0) UBX_Setup(); // inits the GPS-Module via ubx -> try twice |
GPS_Init(); |
// ---------- Prepare the isr driven |
712,6 → 720,13 |
EXT2_Init(); // External Output EXT2 |
CanbusInit(); |
} |
if(FromCamCtrl.CamStatus) |
{ |
u8 msg[30]; |
sprintf(msg, " CamCtrl found V%i.%02i \r\n",1 + FromCamCtrl.Version / 100, FromCamCtrl.Version % 100); |
UART1_PutString(msg); |
} |
else UART1_PutString(" No CamCtrl connected \r\n"); |
// ++++++++++++++++++++++++++++++++++++++++++++++ |
for (;;) // the endless main loop |
{ |