Subversion Repositories NaviCtrl

Rev

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

Rev 91 Rev 92
Line 76... Line 76...
76
 
76
 
77
u32 TimerCompassUpdate;
77
u32 TimerCompassUpdate;
78
u32 TimerCheckError;
78
u32 TimerCheckError;
79
u32 ErrorCode = 0;
79
u32 ErrorCode = 0;
-
 
80
u16 BeepTime;
Line 80... Line 81...
80
u16 BeepTime;
81
u8  NCFlags = 0;
81
 
82
 
82
u8 ClearMKFlags = 0;
83
u8 ClearMKFlags = 0;
83
u8 StopNavigation = 0;
84
u8 StopNavigation = 0;
Line 242... Line 243...
242
        GPS_Init();
243
        GPS_Init();
243
        // initialize fat16 partition on sd card (needs Timer 1)
244
        // initialize fat16 partition on sd card (needs Timer 1)
244
        Fat16_Init();
245
        Fat16_Init();
245
        // initialize the settings
246
        // initialize the settings
246
        Settings_Init();
247
        Settings_Init();
247
        // initialize logging
248
        // initialize logging (needs settings)
248
        Logging_Init();
249
        Logging_Init();
Line 249... Line 250...
249
 
250
 
250
        TimerCompassUpdate = SetDelay(5);
251
        TimerCompassUpdate = SetDelay(5);
251
        TimerCheckError = SetDelay(3000);
252
        TimerCheckError = SetDelay(3000);
Line 270... Line 271...
270
 
271
 
Line 271... Line 272...
271
        SerialPutString("\r\n---------------------------------------------\r\n\r\n");
272
        SerialPutString("\r\n---------------------------------------------\r\n\r\n");
272
 
273
 
273
        for (;;)
-
 
274
        {
-
 
275
                if(rxd_buffer_locked) // new incomming command
274
        for (;;)
276
                {
-
 
277
                         UART1_ProcessRxData();         // process request
275
        {
Line 278... Line 276...
278
                }
276
                UART1_ProcessRxData();  // process request
279
                UART1_TransmitTxData();         // send answer
277
                UART1_TransmitTxData();         // send answer
280
 
278
 
Line 320... Line 318...
320
                        CheckErrors();
318
                        CheckErrors();
321
                        if(FC.MKFlags & MKFLAG_FLY) NaviData.FlyingTime++; // we want to count the battery-time
319
                        if(FC.MKFlags & MKFLAG_FLY) NaviData.FlyingTime++; // we want to count the battery-time
322
//                      else NaviData.FlyingTime = 0;
320
//                      else NaviData.FlyingTime = 0;
323
                        TimerCheckError = SetDelay(1000);
321
                        TimerCheckError = SetDelay(1000);
324
                        Request_SendFollowMe = TRUE;
322
                        Request_SendFollowMe = TRUE;
325
                        if(SerialDataOkay) SerialDataOkay--;
323
                        if(SerialLinkOkay) SerialLinkOkay--;
326
                        if(SerialDataOkay < 250 - 5) NaviData.NCFlags |= NC_NO_SERIAL_DATA;
324
                        if(SerialLinkOkay < 250 - 5) NCFlags |= NC_FLAG_NOSERIALLINK; // 5 seconds timeout for serial communication
327
                        else  NaviData.NCFlags &= ~NC_NO_SERIAL_DATA;
325
                        else NCFlags &= ~NC_FLAG_NOSERIALLINK;
328
                }
326
                }
329
                // ---------------- Logging  ---------------------------------------
327
                // ---------------- Logging  ---------------------------------------
330
                Logging_Update();
328
                Logging_Update();
331
        }
329
        }
332
}
330
}