Subversion Repositories FlightCtrl

Rev

Rev 1660 | Rev 1682 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1660 Rev 1662
Line 149... Line 149...
149
    Timer_Init();
149
    Timer_Init();
150
        TIMER2_Init();
150
        TIMER2_Init();
151
        UART_Init();
151
        UART_Init();
152
    rc_sum_init();
152
    rc_sum_init();
153
        ADC_Init();
153
        ADC_Init();
154
        i2c_init();
154
        I2C_Init();
155
        SPI_MasterInit();
155
        SPI_MasterInit();
156
        Capacity_Init();
156
        Capacity_Init();
157
        LIBFC_Init();
157
        LIBFC_Init();
158
        GRN_ON;
158
        GRN_ON;
159
    sei();
159
    sei();
Line 163... Line 163...
163
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
163
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
164
// + Check connected BL-Ctrls
164
// + Check connected BL-Ctrls
165
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
165
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
166
        // Check connected BL-Ctrls
166
        // Check connected BL-Ctrls
167
        BLFlags |= BLFLAG_READ_VERSION;
167
        BLFlags |= BLFLAG_READ_VERSION;
168
        motorread = 0;  // read the first I2C-Data
168
        motor_read = 0;  // read the first I2C-Data
169
        SendMotorData();
169
        SendMotorData();
170
        while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer
170
        while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer
Line 171... Line 171...
171
 
171
 
172
    printf("\n\rFound BL-Ctrl: ");
172
    printf("\n\rFound BL-Ctrl: ");
Line 273... Line 273...
273
 
273
 
274
            if(!--I2CTimeout || MissingMotor)
274
            if(!--I2CTimeout || MissingMotor)
275
                {
275
                {
276
                  if(!I2CTimeout)
276
                  if(!I2CTimeout)
277
                                   {
277
                                   {
278
                                    i2c_reset();
278
                                    I2C_Reset();
279
                    I2CTimeout = 5;
279
                    I2CTimeout = 5;
280
                                        DebugOut.Analog[28]++; // I2C-Error
280
                                        DebugOut.Analog[28]++; // I2C-Error
281
                                        FCFlags |= FCFLAG_I2CERR;
281
                                        FCFlags |= FCFLAG_I2CERR;
282
                                   }
282
                                   }