HAL_F4Light: Fixed I2C initalization for Airspeed sensor on MatekF405CTR board

This commit is contained in:
timo 2018-05-23 20:30:59 +02:00 committed by Andrew Tridgell
parent 06da94dcea
commit 8cea9a3beb
1 changed files with 4 additions and 1 deletions

View File

@ -187,13 +187,16 @@ void I2CDevice::init(){
if(_dev) {
i2c_init(_dev, _offs, _slow?I2C_250KHz_SPEED:I2C_400KHz_SPEED);
}else {
}else if (s_i2c){
s_i2c->init( );
if(_slow) {
s_i2c->set_low_speed(true);
}
}
else { // neither hardware nor software initalization was successful
return;
}
_initialized=true;
}