diff --git a/libraries/AP_ADC/AP_ADC_ADS1115.cpp b/libraries/AP_ADC/AP_ADC_ADS1115.cpp index d30bf996ac2ce..09ffbbcd340ec 100644 --- a/libraries/AP_ADC/AP_ADC_ADS1115.cpp +++ b/libraries/AP_ADC/AP_ADC_ADS1115.cpp @@ -135,6 +135,11 @@ bool AP_ADC_ADS1115::init() _gain = ADS1115_PGA_4P096; + // initialize the sample cache to ensure we know if it was populated with valid data + for (size_t i = 0; i < _channels_number; i++) { + _samples[i].data = -1.0f; + } + _dev->register_periodic_callback(100000, FUNCTOR_BIND_MEMBER(&AP_ADC_ADS1115::_update, void)); return true; diff --git a/libraries/AP_DroneCAN/dsdl/rb/31000.ADC.uavcan b/libraries/AP_DroneCAN/dsdl/rb/31000.ADC.uavcan new file mode 100644 index 0000000000000..4167ec89b42c5 --- /dev/null +++ b/libraries/AP_DroneCAN/dsdl/rb/31000.ADC.uavcan @@ -0,0 +1 @@ +float32[<=10] voltages diff --git a/libraries/AP_DroneCAN/dsdl/rb/31000.uavcan b/libraries/AP_DroneCAN/dsdl/rb/31000.uavcan deleted file mode 100644 index ea10a4decbf05..0000000000000 --- a/libraries/AP_DroneCAN/dsdl/rb/31000.uavcan +++ /dev/null @@ -1,6 +0,0 @@ -# -# ADC voltages -# - -float32[<=10] voltages # [Volt] -