mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
ADC: added suspend/resume on init
This commit is contained in:
parent
57ac39649a
commit
3115d48ba1
@ -133,6 +133,7 @@ AP_ADC_ADS7844::AP_ADC_ADS7844()
|
|||||||
// Public Methods //////////////////////////////////////////////////////////////
|
// Public Methods //////////////////////////////////////////////////////////////
|
||||||
void AP_ADC_ADS7844::Init( AP_PeriodicProcess * scheduler )
|
void AP_ADC_ADS7844::Init( AP_PeriodicProcess * scheduler )
|
||||||
{
|
{
|
||||||
|
scheduler->suspend_timer();
|
||||||
pinMode(ADC_CHIP_SELECT, OUTPUT);
|
pinMode(ADC_CHIP_SELECT, OUTPUT);
|
||||||
|
|
||||||
digitalWrite(ADC_CHIP_SELECT, HIGH); // Disable device (Chip select is active low)
|
digitalWrite(ADC_CHIP_SELECT, HIGH); // Disable device (Chip select is active low)
|
||||||
@ -159,6 +160,7 @@ void AP_ADC_ADS7844::Init( AP_PeriodicProcess * scheduler )
|
|||||||
|
|
||||||
last_ch6_micros = micros();
|
last_ch6_micros = micros();
|
||||||
|
|
||||||
|
scheduler->resume_timer();
|
||||||
scheduler->register_process( AP_ADC_ADS7844::read );
|
scheduler->register_process( AP_ADC_ADS7844::read );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user