From e5d519edec8650fd5c22105f16d624c10a4363cc Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 11 Jul 2016 14:49:48 -0300 Subject: [PATCH] AP_ADC: AP_ADC_ADS1115: release bus lock as soon as possible --- libraries/AP_ADC/AP_ADC_ADS1115.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/AP_ADC/AP_ADC_ADS1115.cpp b/libraries/AP_ADC/AP_ADC_ADS1115.cpp index 6cbf60f6f5..9ae8832fe6 100644 --- a/libraries/AP_ADC/AP_ADC_ADS1115.cpp +++ b/libraries/AP_ADC/AP_ADC_ADS1115.cpp @@ -223,6 +223,7 @@ void AP_ADC_ADS1115::_update() return; } + _dev->get_semaphore()->give(); float sample = _convert_register_data_to_mv(be16toh(val)); @@ -233,7 +234,5 @@ void AP_ADC_ADS1115::_update() _channel_to_read = (_channel_to_read + 1) % _channels_number; _start_conversion(_channel_to_read); - _dev->get_semaphore()->give(); - _last_update_timestamp = AP_HAL::micros(); }