Subversion Repositories NaviCtrl

Rev

Rev 693 | Rev 706 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 693 Rev 699
Line 98... Line 98...
98
u8 ToFC_MaxWpListIndex = 4;
98
u8 ToFC_MaxWpListIndex = 4;
99
u8 ClearFCStatusFlags = 0;
99
u8 ClearFCStatusFlags = 0;
100
u8 StopNavigation = 0;
100
u8 StopNavigation = 0;
101
volatile u32 PollingTimeout = 10000;
101
volatile u32 PollingTimeout = 10000;
102
Param_t Parameter;
102
Param_t Parameter;
-
 
103
Partner_t Partner;
103
volatile FC_t FC;
104
volatile FC_t FC;
104
volatile u32 SPIWatchDog = 15000; // stop Navigation if this goes to zero
105
volatile u32 SPIWatchDog = 15000; // stop Navigation if this goes to zero
105
volatile u32 SD_WatchDog = 15000; // stop Logging if this goes to zero
106
volatile u32 SD_WatchDog = 15000; // stop Logging if this goes to zero
106
u32 CountGpsProcessedIn5Sec = 50,CountNewGpsDataIn5Sec = 25, FreqGpsNavProcessed = 0, FreqNewGpsData = 0;
107
u32 CountGpsProcessedIn5Sec = 50,CountNewGpsDataIn5Sec = 25, FreqGpsNavProcessed = 0, FreqNewGpsData = 0;
107
u8 NewWPL_Name = 0;
108
u8 NewWPL_Name = 0;
108
u32 MaxWP_Radius_in_m = 0;
109
u32 MaxWP_Radius_in_m = 0;
109
s8 ErrorMSG[25];
110
s8 ErrorMSG[25];
-
 
111
s8 PartnerErrorMSG[25] = "     ---                \0";
110
u32 TimeSinceMotorStart = 0;
112
u32 TimeSinceMotorStart = 0;
-
 
113
u8 IamMaster = NOTHING; // for Master/Slave Redundance
Line 111... Line 114...
111
 
114
 
112
//----------------------------------------------------------------------------------------------------
115
//----------------------------------------------------------------------------------------------------
113
void SCU_Config(void)
116
void SCU_Config(void)
114
{
117
{
Line 414... Line 417...
414
        else if(FC.StatusFlags3 & FC_STATUS3_REDUNDANCE_TEST)
417
        else if(FC.StatusFlags3 & FC_STATUS3_REDUNDANCE_TEST)
415
        {                                                                
418
        {                                                                
416
                sprintf(ErrorMSG,"Redundancy test ");
419
                sprintf(ErrorMSG,"Redundancy test ");
417
                newErrorCode = 37;
420
                newErrorCode = 37;
418
        }
421
        }
-
 
422
        else if(CanbusTimeOut == 1)
-
 
423
        {                                                                
-
 
424
                sprintf(ErrorMSG,"ERR: Canbus");
-
 
425
                newErrorCode = 39;
-
 
426
        }
419
        else // no error occured
427
        else // no error occured
420
        {
428
        {
421
                StopNavigation = 0;
429
                StopNavigation = 0;
422
                LED_RED_OFF;
430
                LED_RED_OFF;
423
                if(no_error_delay) { no_error_delay--;  }
431
                if(no_error_delay) { no_error_delay--;  }
Line 459... Line 467...
459
        if(running) {/*DebugOut.Analog[]++;*/ return(1);};
467
        if(running) {/*DebugOut.Analog[]++;*/ return(1);};
460
        running = 1;
468
        running = 1;
Line 461... Line 469...
461
 
469
 
462
        if(CountMilliseconds != old_ms)  // 1 ms
470
        if(CountMilliseconds != old_ms)  // 1 ms
-
 
471
        {
463
        {
472
                if(CanbusTimeOut >= 2) CanbusTimeOut--;
464
                old_ms = CountMilliseconds;
473
                old_ms = CountMilliseconds;
465
                Compass_Update();               // update compass communication
474
                Compass_Update();               // update compass communication
466
                Analog_Update();                // get new ADC values
475
                Analog_Update();                // get new ADC values
467
                CalcHeadFree();
476
                CalcHeadFree();
Line 610... Line 619...
610
        // initialize the settings
619
        // initialize the settings
611
        Settings_Init();
620
        Settings_Init();
612
        // initialize logging (needs settings)
621
        // initialize logging (needs settings)
613
        Logging_Init();
622
        Logging_Init();
Line -... Line 623...
-
 
623
 
-
 
624
if(UART_VersionInfo.HWMajor < 30) IamMaster = SLAVE; else IamMaster = MASTER;
-
 
625
 
614
 
626
//UART_VersionInfo.HWMajor = 30;
615
        LED_GRN_ON;
627
        LED_GRN_ON;
616
        TimerCheckError = SetDelay(3000);
628
        TimerCheckError = SetDelay(3000);
617
        UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++");
629
        UART1_PutString("\r\n++++++++++++++++++++++++++++++++++++++++++");