SITL: added support for new analog source

removed analogRead() to prevent people using it
This commit is contained in:
Andrew Tridgell 2012-06-29 21:51:38 +10:00
parent 82ede937e7
commit 1fdcc3e8f0
3 changed files with 6 additions and 7 deletions

View File

@ -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);

View File

@ -129,11 +129,6 @@ void digitalWrite(uint8_t pin, uint8_t val)
{
}
int analogRead(uint8_t pin)
{
return 0;
}
}

View File

@ -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;
}