Subversion Repositories FlightCtrl

Rev

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

Rev 1868 Rev 1869
Line 53... Line 53...
53
#include <avr/interrupt.h>
53
#include <avr/interrupt.h>
54
#include "eeprom.h"
54
#include "eeprom.h"
55
#include "analog.h"
55
#include "analog.h"
Line 56... Line 56...
56
 
56
 
57
// for debugging!
57
// for debugging!
-
 
58
#include "uart0.h"
Line 58... Line 59...
58
#include "rc.h"
59
#include "output.h"
59
 
60
 
60
#ifdef USE_MK3MAG
61
#ifdef USE_MK3MAG
Line 139... Line 140...
139
 
140
 
140
#ifdef USE_NAVICTRL
141
#ifdef USE_NAVICTRL
141
        if(SendSPI) SendSPI--; // if SendSPI is 0, the transmit of a byte via SPI bus to and from The Navicontrol is done
142
        if(SendSPI) SendSPI--; // if SendSPI is 0, the transmit of a byte via SPI bus to and from The Navicontrol is done
Line 142... Line 143...
142
#endif
143
#endif
143
 
144
 
144
        if (!cnt--) { // every 10th run (9.765kHz/10 = 976Hz)
145
        if (!cnt--) { // every 10th run (9.765625kHz/10 = 976.5625Hz)
145
                cnt = 9;
146
                cnt = 9;
146
                cnt_1ms ^= 1;
147
                cnt_1ms ^= 1;
-
 
148
                if (!cnt_1ms) {
147
                if (!cnt_1ms) {
149
                        runFlightControl = 1; // every 2nd run (976.5625 Hz/2 = 488.28125 Hz)
148
                        runFlightControl = 1; // every 2nd run (976.5625 Hz/2 = 488.28125 Hz)
150
                        DebugOut.Digital[0] |= DEBUG_MAINLOOP_TIMER;
149
                }
151
                }
Line 150... Line 152...
150
                CountMilliseconds++; // increment millisecond counter
152
                CountMilliseconds++; // increment millisecond counter