Subversion Repositories FlightCtrl

Rev

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

Rev 1400 Rev 1452
Line 231... Line 231...
231
         Mixer.Revision = MIXER_REVISION;
231
         Mixer.Revision = MIXER_REVISION;
232
     memcpy(Mixer.Name, "Quadro\0", 11);
232
     memcpy(Mixer.Name, "Quadro\0", 11);
233
     eeprom_write_block(&Mixer, &EEPromArray[EEPROM_ADR_MIXER_TABLE], sizeof(Mixer));
233
     eeprom_write_block(&Mixer, &EEPromArray[EEPROM_ADR_MIXER_TABLE], sizeof(Mixer));
234
    }
234
    }
235
    printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name,RequiredMotors);
235
    printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name,RequiredMotors);
236
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 
237
// + Check connected BL-Ctrls
-
 
238
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 
239
        printf("\n\rFound BL-Ctrl: ");
-
 
240
    motorread = 0;   UpdateMotor = 0;   SendMotorData(); while(!UpdateMotor); motorread = 0;  // read the first I2C-Data
-
 
241
    timer = SetDelay(2000);
-
 
242
        for(i=0; i < MAX_MOTORS; i++)
-
 
243
         {
-
 
244
          UpdateMotor = 0;
-
 
245
      SendMotorData();
-
 
246
          while(!UpdateMotor);
-
 
247
      if(Mixer.Motor[i][0] > 0) // wait max 2 sec for the BL-Ctrls to wake up
-
 
248
        {
-
 
249
             while(!CheckDelay(timer) && !MotorPresent[i]) {UpdateMotor = 0; SendMotorData(); while(!UpdateMotor);};
-
 
250
                }
-
 
251
          if(MotorPresent[i]) printf("%d ",i+1);
-
 
252
     }
-
 
253
        for(i=0; i < MAX_MOTORS; i++)
-
 
254
         {
-
 
255
          if(!MotorPresent[i] && Mixer.Motor[i][0] > 0)
-
 
256
           {
-
 
257
            printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1);
-
 
258
                ServoActive = 1; // just in case the FC would be used as camera-stabilizer
-
 
259
           }   
-
 
260
          MotorError[i] = 0;
-
 
261
     }
-
 
262
        printf("\n\r===================================");
-
 
263
    SendMotorData();
-
 
Line 264... Line 236...
264
 
236
 
265
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
237
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
266
// + Check Settings
238
// + Check Settings
267
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
239
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Line 368... Line 340...
368
                           {
340
                           {
369
                    GPS_Nick = 0;
341
                    GPS_Nick = 0;
370
                GPS_Roll = 0;
342
                GPS_Roll = 0;
371
               }
343
               }
372
              }
344
              }
373
            if(!--I2CTimeout || MissingMotor)
345
            if(!--I2CTimeout)
374
                {
346
                {
375
                  if(!I2CTimeout)
347
                  if(!I2CTimeout)
376
                                   {
348
                                   {
377
                                    i2c_reset();
349
                                    i2c_reset();
378
                    I2CTimeout = 5;
350
                    I2CTimeout = 5;