83,6 → 83,7 |
#include "sdc.h" |
#include "uart1.h" |
#include "canbus.h" |
#include "triggerlog.h" |
|
|
#ifdef FOLLOW_ME |
161,7 → 162,6 |
if(UART_VersionInfo.HardwareError[0] || UART_VersionInfo.HardwareError[1]) DebugOut.StatusRed |= AMPEL_NC; |
else DebugOut.StatusRed &= ~AMPEL_NC; |
|
|
if(CheckDelay(I2CBus(Compass_I2CPort)->Timeout)) |
{ |
LED_RED_ON; |
288,8 → 288,6 |
UART_VersionInfo.Flags &= ~NC_VERSION_FLAG_GPS_PRESENT; |
newErrorCode = 5; |
StopNavigation = 1; |
//UBX_Setup(); |
//UBX_Timeout = SetDelay(500); |
} |
else if(Compass_Heading < 0 && NCMAG_Present && !NCMAG_IsCalibrated) |
{ |
320,6 → 318,19 |
sprintf(ErrorMSG,"FC: Carefree Error"); |
newErrorCode = 20; |
} |
else if(FC.BAT_Voltage < 45) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR:Power Supply"); |
newErrorCode = 41; |
} |
else |
if(FC.Error[1] & FC_ERROR1_RC_VOLTAGE) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR: 5V RC-Supply"); |
newErrorCode = 40; |
} |
else if(FC.Error[1] & FC_ERROR1_PPM) |
{ |
LED_RED_ON; |
424,6 → 435,13 |
sprintf(ErrorMSG,"ERR: Canbus"); |
newErrorCode = 39; |
} |
else |
if(FC.Error[1] & FC_ERROR1_ACC_NOT_CAL) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ACC not calib."); |
newErrorCode = 42; |
} |
else // no error occured |
{ |
StopNavigation = 0; |
520,6 → 538,7 |
{ |
if(CheckDelay(TimerCheckError)) |
{ |
if(!BLITZ_CONNECTED) BlitzSchuhConnected = 1; else BlitzSchuhConnected = 0; |
TimerCheckError = SetDelay(1000); |
if(CompassValueErrorCount) CompassValueErrorCount--; |
if(++count5sec == 5) |
621,8 → 640,6 |
// initialize logging (needs settings) |
Logging_Init(); |
|
if(UART_VersionInfo.HWMajor < 30) IamMaster = SLAVE; else IamMaster = MASTER; |
|
//UART_VersionInfo.HWMajor = 30; |
LED_GRN_ON; |
TimerCheckError = SetDelay(3000); |
636,9 → 653,6 |
|
Compass_Init(); |
|
UBX_Setup(); // inits the GPS-Module via ubx |
GPS_Init(); |
|
#ifdef FOLLOW_ME |
TransmitAlsoToFC = 1; |
UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++"); |
653,7 → 667,11 |
LED_RED_ON; |
} |
#endif |
if(IamMaster == SLAVE) UART1_PutString(" SLAVE\r\n"); |
if(IamMaster == MASTER) UART1_PutString(" MASTER\r\n"); |
|
UBX_Setup(); // inits the GPS-Module via ubx |
GPS_Init(); |
// ---------- Prepare the isr driven |
// set to absolute lowest priority |
VIC_Config(EXTIT3_ITLine, VIC_IRQ, PRIORITY_SW); |