Subversion Repositories NaviCtrl

Rev

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

Rev 196 Rev 199
Line 82... Line 82...
82
u32 ErrorCode = 0;
82
u32 ErrorCode = 0;
83
u16 BeepTime;
83
u16 BeepTime;
84
u8  NCFlags = 0;
84
u8  NCFlags = 0;
85
s16 GeoMagDec = 0; // local magnetic declination in 0.1 deg
85
s16 GeoMagDec = 0; // local magnetic declination in 0.1 deg
Line 86... Line 86...
86
 
86
 
87
u8 ClearMKFlags = 0;
87
u8 ClearFCFlags = 0;
88
u8 StopNavigation = 0;
88
u8 StopNavigation = 0;
89
Param_t Parameter;
89
Param_t Parameter;
Line 90... Line 90...
90
volatile FC_t FC;
90
volatile FC_t FC;
Line 169... Line 169...
169
                LED_RED_ON;
169
                LED_RED_ON;
170
                sprintf(ErrorMSG,"bad compass value ");
170
                sprintf(ErrorMSG,"bad compass value ");
171
                ErrorCode = 6;
171
                ErrorCode = 6;
172
                StopNavigation = 1;
172
                StopNavigation = 1;
173
        }
173
        }
-
 
174
        else if(FC.Flags & FCFLAG_SPI_RX_ERR)
-
 
175
        {
-
 
176
                LED_RED_ON;
-
 
177
                sprintf(ErrorMSG,"FC spi rx error ");
-
 
178
                ErrorCode = 8;
-
 
179
                StopNavigation = 1;    
-
 
180
        }
174
        else if(FC.RC_Quality < 100)
181
        else if(FC.RC_Quality < 100)
175
        {
182
        {
176
                LED_RED_ON;
183
                LED_RED_ON;
177
                sprintf(ErrorMSG,"RC Signal lost ");
184
                sprintf(ErrorMSG,"RC Signal lost ");
178
                ErrorCode = 7;
185
                ErrorCode = 7;
Line 289... Line 296...
289
                if(CheckDelay(TimerCheckError))
296
                if(CheckDelay(TimerCheckError))
290
                {
297
                {
291
                        TimerCheckError = SetDelay(1000);
298
                        TimerCheckError = SetDelay(1000);
292
                        if(CheckDelay(SPI0_Timeout)) GPS_Navigation(); // process the GPS data even if the FC is not connected
299
                        if(CheckDelay(SPI0_Timeout)) GPS_Navigation(); // process the GPS data even if the FC is not connected
293
                        CheckErrors();
300
                        CheckErrors();
294
                        if(FC.MKFlags & MKFLAG_FLY) NaviData.FlyingTime++; // we want to count the battery-time
301
                        if(FC.Flags & FCFLAG_FLY) NaviData.FlyingTime++; // we want to count the battery-time
295
//                      else NaviData.FlyingTime = 0; // not the time per flight
302
//                      else NaviData.FlyingTime = 0; // not the time per flight
296
                        UART1_Request_SendFollowMe = TRUE;
303
                        UART1_Request_SendFollowMe = TRUE;
297
                        if(SerialLinkOkay) SerialLinkOkay--;
304
                        if(SerialLinkOkay) SerialLinkOkay--;
298
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
305
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
299
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
306
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;