Subversion Repositories FlightCtrl

Rev

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

Rev 2018 Rev 2039
Line 70... Line 70...
70
#include "twimaster.h"
70
#include "twimaster.h"
71
#include "controlMixer.h"
71
#include "controlMixer.h"
72
#ifdef USE_NAVICTRL
72
#ifdef USE_NAVICTRL
73
#include "spi.h"
73
#include "spi.h"
74
#endif
74
#endif
75
#ifdef USE_MK3MAG
75
#ifdef USE_DIRECT_GPS
76
#include "mk3mag.h"
76
#include "mk3mag.h"
77
#endif
77
#endif
78
#include "eeprom.h"
78
#include "eeprom.h"
Line 79... Line 79...
79
 
79
 
Line 106... Line 106...
106
  analog_init();
106
  analog_init();
107
  I2C_init();
107
  I2C_init();
108
#ifdef USE_NAVICTRL
108
#ifdef USE_NAVICTRL
109
  SPI_MasterInit();
109
  SPI_MasterInit();
110
#endif
110
#endif
111
#ifdef USE_MK3MAG
111
#ifdef USE_DIRECT_GPS
112
  MK3MAG_Init();
112
  MK3MAG_init();
-
 
113
  usart1_init();
113
#endif
114
#endif
Line 114... Line 115...
114
 
115
 
115
  // Parameter Set handling
116
  // Parameter Set handling
116
  channelMap_readOrDefault();
117
  channelMap_readOrDefault();
Line 160... Line 161...
160
 
161
 
Line 161... Line 162...
161
  printf("\n\r===================================");
162
  printf("\n\r===================================");
162
 
163
 
163
#ifdef USE_NAVICTRL
-
 
164
  printf("\n\rSupport for NaviCtrl");
-
 
165
#ifdef USE_RC_DSL
-
 
166
  printf("\r\nSupport for DSL RC at 2nd UART");
-
 
167
#endif
-
 
168
#ifdef USE_RC_SPECTRUM
-
 
169
  printf("\r\nSupport for SPECTRUM RC at 2nd UART");
-
 
170
#endif
-
 
171
#endif
-
 
172
 
-
 
173
#ifdef USE_MK3MAG
164
#ifdef USE_NAVICTRL
Line 174... Line 165...
174
  printf("\n\rSupport for MK3MAG Compass");
165
  printf("\n\rSupport for NaviCtrl");
175
#endif
166
#endif
176
 
-
 
177
#if (defined (USE_MK3MAG))
167
 
Line 178... Line 168...
178
  if(CPUType == ATMEGA644P) printf("\n\r2 UART");
168
#ifdef USE_DIRECT_GPS
Line 179... Line 169...
179
  else printf("\n\r1 UART");
169
  printf("\n\rDirect (no NaviCtrl) navigation");
Line 208... Line 198...
208
        debugOut.digital[0] |= DEBUG_MAINLOOP_TIMER;
198
        debugOut.digital[0] |= DEBUG_MAINLOOP_TIMER;
209
      } else {
199
      } else {
210
        debugOut.digital[0] &= ~DEBUG_MAINLOOP_TIMER;
200
        debugOut.digital[0] &= ~DEBUG_MAINLOOP_TIMER;
Line 211... Line 201...
211
 
201
 
-
 
202
        J4HIGH;
-
 
203
        calculateFlightAttitude();
212
        J4HIGH;
204
        controlMixer_periodicTask();
213
        flight_control();
205
        flight_control();
Line 214... Line 206...
214
        J4LOW;
206
        J4LOW;
215
 
207