Subversion Repositories NaviCtrl

Rev

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

Rev 528 Rev 530
Line 134... Line 134...
134
//----------------------------------------------------------------------------------------------------
134
//----------------------------------------------------------------------------------------------------
135
void GetNaviCtrlVersion(void)
135
void GetNaviCtrlVersion(void)
136
{
136
{
137
        u8 msg[25];
137
        u8 msg[25];
Line 138... Line 138...
138
 
138
 
139
        sprintf(msg,"\n\r NaviCtrl HW: V%d.%d SW: V%d.%02d%c",  Version_HW/10, Version_HW%10, VERSION_MAJOR,  VERSION_MINOR, 'a'+ VERSION_PATCH);
139
        sprintf(msg,"\n\r NaviCtrl HW: V%d.%d SW: V%d.%02d%c", UART_VersionInfo.HWMajor/10, UART_VersionInfo.HWMajor%10, VERSION_MAJOR,  VERSION_MINOR, 'a'+ VERSION_PATCH);
140
        UART1_PutString(msg);
140
        UART1_PutString(msg);
Line 141... Line 141...
141
}
141
}
Line 337... Line 337...
337
                sprintf(ErrorMSG,"Magnet error    ");
337
                sprintf(ErrorMSG,"Magnet error    ");
338
                newErrorCode = 22;
338
                newErrorCode = 22;
339
                DebugOut.StatusRed |= AMPEL_COMPASS | AMPEL_NC;
339
                DebugOut.StatusRed |= AMPEL_COMPASS | AMPEL_NC;
340
                UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE;
340
                UART_VersionInfo.HardwareError[0] |= NC_ERROR0_COMPASS_VALUE;
341
        }
341
        }
342
        else if(((BL_MinOfMaxPWM == 40 && (FC.StatusFlags & FC_STATUS_FLY)) || BL_MinOfMaxPWM == 39) && !ErrorCode)
342
        else if(((ErrorCheck_BL_MinOfMaxPWM == 40 && (FC.StatusFlags & FC_STATUS_FLY)) || ErrorCheck_BL_MinOfMaxPWM == 39) && !ErrorCode)
343
        {
343
        {
344
                LED_RED_ON;
344
                LED_RED_ON;
345
                sprintf(ErrorMSG,"ERR:Motor restart  ");
345
                sprintf(ErrorMSG,"ERR:Motor restart  ");
346
                newErrorCode = 23;
346
                newErrorCode = 23;
347
                DebugOut.StatusRed |= AMPEL_BL;
347
                DebugOut.StatusRed |= AMPEL_BL;
Line 353... Line 353...
353
                LED_RED_ON;
353
                LED_RED_ON;
354
                sprintf(ErrorMSG,"ERR:BL%2d Test:%2d ",i+1,BL_MinOfMaxPWM);
354
                sprintf(ErrorMSG,"ERR:BL%2d Test:%2d ",i+1,BL_MinOfMaxPWM);
355
                newErrorCode = 32;
355
                newErrorCode = 32;
356
                DebugOut.StatusRed |= AMPEL_BL;
356
                DebugOut.StatusRed |= AMPEL_BL;
357
        }
357
        }
358
        else if(BL_MinOfMaxPWM < 248 && (FC.StatusFlags & FC_STATUS_FLY) && !ErrorCode)
358
        else if(ErrorCheck_BL_MinOfMaxPWM < 248 && (FC.StatusFlags & FC_STATUS_FLY) && !ErrorCode)
359
        {
359
        {
360
                LED_RED_ON;
360
                LED_RED_ON;
361
                sprintf(ErrorMSG,"ERR:BL Limitation   ");
361
                sprintf(ErrorMSG,"ERR:BL Limitation   ");
362
                newErrorCode = 24;
362
                newErrorCode = 24;
363
                DebugOut.StatusRed |= AMPEL_BL;
363
                DebugOut.StatusRed |= AMPEL_BL;
Line 418... Line 418...
418
 FC.Error[1] = 0;
418
 FC.Error[1] = 0;
419
 FC.Error[2] = 0;
419
 FC.Error[2] = 0;
420
 FC.Error[3] = 0;
420
 FC.Error[3] = 0;
421
 FC.Error[4] = 0;
421
 FC.Error[4] = 0;
422
 ErrorGpsFixLost = 0;
422
 ErrorGpsFixLost = 0;
-
 
423
 ErrorCheck_BL_MinOfMaxPWM = BL_MinOfMaxPWM;
423
}
424
}
Line 424... Line 425...
424
 
425
 
Line 585... Line 586...
585
        Debug_OK("START");
586
        Debug_OK("START");
586
        UART1_PutString("\r\n");
587
        UART1_PutString("\r\n");
587
        fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer
588
        fifo_purge(&UART1_rx_fifo); // flush the whole fifo init buffer
588
        LED_GRN_ON;
589
        LED_GRN_ON;
589
        LED_RED_OFF;
590
        LED_RED_OFF;
590
    Settings_GetParamValue(PID_SEND_NMEA, &NMEA_Interval);
591
    Settings_GetParamValue(PID_SEND_NMEA,(u16 *) &NMEA_Interval);
591
        UART1_PutString("\r\n");
592
        UART1_PutString("\r\n");
Line 592... Line 593...
592
 
593
 
593
        CompassValueErrorCount = 0;
594
        CompassValueErrorCount = 0;
594
        I2CBus(Compass_I2CPort)->Timeout = SetDelay(3000);
-
 
595
 
595
        I2CBus(Compass_I2CPort)->Timeout = SetDelay(3000);
596
// ++++++++++++++++++++++++++++++++++++++++++++++
596
// ++++++++++++++++++++++++++++++++++++++++++++++
597
        for (;;) // the endless main loop
597
        for (;;) // the endless main loop
598
        {
598
        {
599
                PollingTimeout = 5;
599
                PollingTimeout = 5;