mirror of https://github.com/ArduPilot/ardupilot
SITL: added support for new analog source
removed analogRead() to prevent people using it
This commit is contained in:
parent
e791cad9ef
commit
0341e0e5f0
|
@ -95,7 +95,7 @@ extern "C"{
|
|||
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
|
||||
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
|
||||
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
|
||||
|
||||
#define bit_is_set(value, bit) (((value) & bit) != 0)
|
||||
|
||||
typedef unsigned int word;
|
||||
|
||||
|
@ -109,7 +109,6 @@ void init(void);
|
|||
void pinMode(uint8_t, uint8_t);
|
||||
void digitalWrite(uint8_t, uint8_t);
|
||||
int digitalRead(uint8_t);
|
||||
int analogRead(uint8_t);
|
||||
void analogReference(uint8_t mode);
|
||||
void analogWrite(uint8_t, int);
|
||||
|
||||
|
|
|
@ -129,11 +129,6 @@ void digitalWrite(uint8_t pin, uint8_t val)
|
|||
{
|
||||
}
|
||||
|
||||
int analogRead(uint8_t pin)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -268,6 +268,11 @@ static void timer_handler(int signum)
|
|||
sitl.state.airspeed);
|
||||
sitl_update_barometer(sitl.state.altitude);
|
||||
sitl_update_compass(sitl.state.rollDeg, sitl.state.pitchDeg, sitl.state.heading);
|
||||
|
||||
// clear the ADC conversion flag,
|
||||
// so the ADC code doesn't get stuck
|
||||
ADCSRA &= ~_BV(ADSC);
|
||||
|
||||
sei();
|
||||
running = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue