AP_HAL_AVR: analog input fixed when ANALOG_INPUT_NONE

* need to provide new sample so we dont spin forever
This commit is contained in:
Pat Hickey 2012-12-05 18:33:42 -08:00 committed by Andrew Tridgell
parent 2826a605ba
commit 765e2da8a7
1 changed files with 1 additions and 0 deletions

View File

@ -70,6 +70,7 @@ void AVRAnalogIn::_register_channel(ADCSource* ch) {
void AVRAnalogIn::_timer_event(uint32_t t) { void AVRAnalogIn::_timer_event(uint32_t t) {
if (_channels[_active_channel]->_pin == ANALOG_INPUT_NONE) { if (_channels[_active_channel]->_pin == ANALOG_INPUT_NONE) {
_channels[_active_channel]->new_sample(0);
goto next_channel; goto next_channel;
} }