233,34 → 233,6 |
eeprom_write_block(&Mixer, &EEPromArray[EEPROM_ADR_MIXER_TABLE], sizeof(Mixer)); |
} |
printf("\n\rMixer-Config: '%s' (%u Motors)",Mixer.Name,RequiredMotors); |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Check connected BL-Ctrls |
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
printf("\n\rFound BL-Ctrl: "); |
motorread = 0; UpdateMotor = 0; SendMotorData(); while(!UpdateMotor); motorread = 0; // read the first I2C-Data |
timer = SetDelay(2000); |
for(i=0; i < MAX_MOTORS; i++) |
{ |
UpdateMotor = 0; |
SendMotorData(); |
while(!UpdateMotor); |
if(Mixer.Motor[i][0] > 0) // wait max 2 sec for the BL-Ctrls to wake up |
{ |
while(!CheckDelay(timer) && !MotorPresent[i]) {UpdateMotor = 0; SendMotorData(); while(!UpdateMotor);}; |
} |
if(MotorPresent[i]) printf("%d ",i+1); |
} |
for(i=0; i < MAX_MOTORS; i++) |
{ |
if(!MotorPresent[i] && Mixer.Motor[i][0] > 0) |
{ |
printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1); |
ServoActive = 1; // just in case the FC would be used as camera-stabilizer |
} |
MotorError[i] = 0; |
} |
printf("\n\r==================================="); |
SendMotorData(); |
|
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
// + Check Settings |
370,7 → 342,7 |
GPS_Roll = 0; |
} |
} |
if(!--I2CTimeout || MissingMotor) |
if(!--I2CTimeout) |
{ |
if(!I2CTimeout) |
{ |