mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
Baro: added suspend/resume on init
This commit is contained in:
parent
d692a932ca
commit
88b2139d91
@ -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 )
|
|||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user