Subversion Repositories FlightCtrl

Rev

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

Rev 724 Rev 726
Line 113... Line 113...
113
 
113
 
114
        // initalize modules
114
        // initalize modules
115
    TIMER0_Init();
115
    TIMER0_Init();
116
    TIMER2_Init();
116
    TIMER2_Init();
117
        USART0_Init();
-
 
118
        ubx_init();
117
        USART0_Init();
119
        if (BoardRelease == 11) USART1_Init();
118
        if (BoardRelease == 11) USART1_Init();
120
    RC_Init();
119
    RC_Init();
121
        ADC_Init();
120
        ADC_Init();
122
        i2c_init();
121
        I2C_Init();
123
        MM3_init();
122
        MM3_Init();
Line 124... Line 123...
124
        //SPI_MasterInit();
123
        //SPI_MasterInit();
125
 
124
 
Line 148... Line 147...
148
 
147
 
149
        //Compass calibration?
148
        //Compass calibration?
150
        if(PPM_in[ParamSet.ChannelAssignment[CH_THRUST]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_YAW]] > 100)
149
        if(PPM_in[ParamSet.ChannelAssignment[CH_THRUST]] > 100 && PPM_in[ParamSet.ChannelAssignment[CH_YAW]] > 100)
151
        {
150
        {
152
                printf("\n\rCalibrating Compass");
151
                printf("\n\rCalibrating Compass");
153
                MM3_calibrate();
152
                MM3_Calibrate();
Line 154... Line 153...
154
        }
153
        }
155
 
154
 
Line 204... Line 203...
204
              }
203
              }
205
              if(SenderOkay)  SenderOkay--;
204
              if(SenderOkay)  SenderOkay--;
206
              if(!I2CTimeout)
205
              if(!I2CTimeout)
207
                {
206
                {
208
                 I2CTimeout = 5;
207
                 I2CTimeout = 5;
209
                 i2c_reset();
208
                 I2C_Reset();
210
                  if((BeepModulation == 0xFFFF) && MotorsOn)
209
                  if((BeepModulation == 0xFFFF) && MotorsOn)
211
                   {
210
                   {
212
                    BeepTime = 10000; // 1 second
211
                    BeepTime = 10000; // 1 second
213
                    BeepModulation = 0x0080;
212
                    BeepModulation = 0x0080;
214
                   }
213
                   }