Subversion Repositories FlightCtrl

Rev

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

Rev 903 Rev 909
Line 71... Line 71...
71
#include "mm3.h"
71
#include "mm3.h"
72
#endif
72
#endif
73
#ifdef USE_NAVICTRL
73
#ifdef USE_NAVICTRL
74
#include "spi.h"
74
#include "spi.h"
75
#endif
75
#endif
76
#if !defined (USE_KILLAGREG) && !defined (USE_NAVICTRL)
76
#ifdef USE_MK3MAG
77
#include "mk3mag.h"
77
#include "mk3mag.h"
78
#endif
78
#endif
79
#include "twimaster.h"
79
#include "twimaster.h"
80
#include "eeprom.h"
80
#include "eeprom.h"
81
#include "_Settings.h"
81
#include "_Settings.h"
Line 132... Line 132...
132
 
132
 
133
    RC_Init();
133
    RC_Init();
134
        ADC_Init();
134
        ADC_Init();
Line 135... Line -...
135
        I2C_Init();
-
 
136
 
-
 
137
        #ifdef USE_KILLAGREG
135
        I2C_Init();
138
        MM3_Init();
136
 
139
        #endif
137
 
140
        #ifdef USE_NAVICTRL
138
        #ifdef USE_NAVICTRL
141
        SPI_MasterInit();
139
        SPI_MasterInit();
-
 
140
        #endif
-
 
141
        #ifdef USE_KILLAGREG
-
 
142
        MM3_Init();
142
        #endif
143
        #endif
143
        #if !defined (USE_KILLAGREG) && !defined (USE_NAVICTRL)
144
        #ifdef USE_MK3MAG
Line 144... Line 145...
144
        MK3MAG_Init();
145
        MK3MAG_Init();
Line 167... Line 168...
167
        //wait for a short time (otherwise the RC channel check won't work below)
168
        //wait for a short time (otherwise the RC channel check won't work below)
168
        timer = SetDelay(500);
169
        timer = SetDelay(500);
169
        while(!CheckDelay(timer));
170
        while(!CheckDelay(timer));
Line 170... Line -...
170
 
-
 
171
 
-
 
172
        #if !defined (USE_KILLAGREG) && !defined (USE_NAVICTRL)
-
 
173
        printf("\n\rSupport for MK3MAG Compass");
-
 
174
        #endif
-
 
175
 
171
 
176
 
172
 
177
        if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL)
173
        if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL)
178
         {
174
         {
179
           printf("\n\rCalibrating air pressure sensor..");
175
           printf("\n\rCalibrating air pressure sensor..");
180
           timer = SetDelay(1000);
176
           timer = SetDelay(1000);
181
       SearchAirPressureOffset();
177
       SearchAirPressureOffset();
182
           while (!CheckDelay(timer));
178
           while (!CheckDelay(timer));
Line -... Line 179...
-
 
179
       printf("OK\n\r");
-
 
180
        }
-
 
181
 
-
 
182
        #ifdef USE_NAVICTRL
183
       printf("OK\n\r");
183
        printf("\n\rSupport for NaviCtrl");
184
        }
184
        #endif
-
 
185
 
-
 
186
        #ifdef USE_KILLAGREG
-
 
187
        printf("\n\rSupport for MicroMag3 Compass");
-
 
188
        #endif
-
 
189
        #ifdef USE_MK3MAG
-
 
190
        printf("\n\rSupport for MK3MAG Compass");
-
 
191
        #endif
-
 
192
 
185
 
193
 
186
        #ifdef USE_KILLAGREG
194
 
187
        printf("\n\rSupport for MicroMag3 Compass");
195
        #if defined (USE_KILLAGREG) || defined (USE_MK3MAG)
188
        #if defined (__AVR_ATmega644P__)
196
        #if defined (__AVR_ATmega644P__)
189
        if(BoardRelease == 10)
197
        if(BoardRelease == 10)
190
        {
198
        {
191
                printf("\n\rSupport for GPS at 1st UART");
199
                printf("\n\rSupport for GPS at 1st UART");
192
        }
200
        }
193
        else
201
        else
194
        {
202
        {
195
                printf("\n\rSupport for GPS at 2nd UART");
203
                printf("\n\rSupport for GPS at 2nd UART");
196
        }
204
        }
197
        #else // (__AVR_ATmega644__)
205
        #else // (__AVR_ATmega644__)
Line -... Line 206...
-
 
206
        printf("\n\rSupport for GPS at 1st UART");
-
 
207
        #endif
198
                printf("\n\rSupport for GPS at 1st UART");
208
        #endif
Line 199... Line 209...
199
        #endif
209
 
Line 200... Line 210...
200
        #endif
210