Subversion Repositories NaviCtrl

Rev

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

Rev 213 Rev 215
Line 61... Line 61...
61
#include "91x_lib.h"
61
#include "91x_lib.h"
62
#include "led.h"
62
#include "led.h"
63
#include "uart0.h"
63
#include "uart0.h"
64
#include "uart1.h"
64
#include "uart1.h"
65
#include "uart2.h"
65
#include "uart2.h"
66
#include "GPS.h"
66
#include "gps.h"
67
#include "i2c.h"
67
#include "i2c.h"
68
#include "timer1.h"
68
#include "timer1.h"
69
#include "timer2.h"
69
#include "timer2.h"
70
#include "analog.h"
70
#include "analog.h"
71
#include "spi_slave.h"
71
#include "spi_slave.h"
Line 294... Line 294...
294
                SPI0_UpdateBuffer();    // handle new SPI Data
294
                SPI0_UpdateBuffer();    // handle new SPI Data
295
                // ---------------- Error Check Timing ----------------------------
295
                // ---------------- Error Check Timing ----------------------------
296
                if(CheckDelay(TimerCheckError))
296
                if(CheckDelay(TimerCheckError))
297
                {
297
                {
298
                        TimerCheckError = SetDelay(1000);
298
                        TimerCheckError = SetDelay(1000);
299
                        if(CheckDelay(SPI0_Timeout)) GPS_Navigation(); // process the GPS data even if the FC is not connected
299
                        if(CheckDelay(SPI0_Timeout)) GPS_Navigation(&GPSData, &(ToFlightCtrl.GPSStick)); // process the GPS data even if the FC is not connected
300
                        CheckErrors();
300
                        CheckErrors();
301
                        if(FC.Flags & FCFLAG_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
302
//                      else NaviData.FlyingTime = 0; // not the time per flight
302
//                      else NaviData.FlyingTime = 0; // not the time per flight
303
                        UART1_Request_SendFollowMe = TRUE;
-
 
304
                        if(SerialLinkOkay) SerialLinkOkay--;
303
                        if(SerialLinkOkay) SerialLinkOkay--;
305
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
304
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
306
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
305
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
307
                }
306
                }
308
                // ---------------- Logging  ---------------------------------------
307
                // ---------------- Logging  ---------------------------------------