Browse Source

AP_Baro: fixed MS5611 initialisation in order to get rid off conflicts with other I2C devices

master
Staroselskii Georgii 10 years ago committed by Andrew Tridgell
parent
commit
43c88c37eb
  1. 2
      libraries/AP_Baro/AP_Baro_MS5611.cpp

2
libraries/AP_Baro/AP_Baro_MS5611.cpp

@ -287,6 +287,7 @@ bool AP_Baro_MS5611::check_crc(void) @@ -287,6 +287,7 @@ bool AP_Baro_MS5611::check_crc(void)
// SPI should be initialized externally
bool AP_Baro_MS5611::init()
{
hal.scheduler->suspend_timer_procs();
if (_serial == NULL) {
hal.scheduler->panic(PSTR("PANIC: AP_Baro_MS5611: NULL serial driver"));
return false; /* never reached */
@ -330,6 +331,7 @@ bool AP_Baro_MS5611::init() @@ -330,6 +331,7 @@ bool AP_Baro_MS5611::init()
_d1_count = 0;
_d2_count = 0;
hal.scheduler->resume_timer_procs();
hal.scheduler->register_timer_process( AP_HAL_MEMBERPROC(&AP_Baro_MS5611::_update));
_serial->sem_give();

Loading…
Cancel
Save