Skip to content
Snippets Groups Projects
Commit ae1702c2 authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

Baro: added suspend/resume on init

parent 3115d48b
No related branches found
No related tags found
No related merge requests found
...@@ -113,6 +113,8 @@ void AP_Baro_MS5611::_spi_write(uint8_t reg) ...@@ -113,6 +113,8 @@ void AP_Baro_MS5611::_spi_write(uint8_t reg)
// SPI should be initialized externally // SPI should be initialized externally
bool AP_Baro_MS5611::init( AP_PeriodicProcess *scheduler ) bool AP_Baro_MS5611::init( AP_PeriodicProcess *scheduler )
{ {
scheduler->suspend_timer();
pinMode(MS5611_CS, OUTPUT); // Chip select Pin pinMode(MS5611_CS, OUTPUT); // Chip select Pin
digitalWrite(MS5611_CS, HIGH); digitalWrite(MS5611_CS, HIGH);
delay(1); delay(1);
...@@ -137,6 +139,7 @@ bool AP_Baro_MS5611::init( AP_PeriodicProcess *scheduler ) ...@@ -137,6 +139,7 @@ bool AP_Baro_MS5611::init( AP_PeriodicProcess *scheduler )
Temp=0; Temp=0;
Press=0; Press=0;
scheduler->resume_timer();
scheduler->register_process( AP_Baro_MS5611::_update ); scheduler->register_process( AP_Baro_MS5611::_update );
healthy = true; healthy = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment