Commit da9b3085 authored by Maksim Salau's avatar Maksim Salau Committed by Alberto Escolar
Browse files

drivers: adc: saadc: Disable burst mode on unused channels

Burst mode enabled on an unused channel causes a freeze during a
conversion consisting of several channels (not including the one with
burst mode enabled).

Discovered on nRF52832 (nRF52-DK) using the following approach:
  channels 0-3 are used for application purposes as a sequence
  channel 4 is used for battery measurements with oversampling

After few successful conversions the sequence (channels 0-3) freezes the
thread while waiting for semaphore to end the conversion.

Signed-off-by: default avatarMaksim Salau <maksim.salau@gmail.com>
parent 37d62c6a
Loading
Loading
Loading
Loading
+4 −0
Changes for drivers/adc/adc_nrfx_saadc.c: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -479,6 +479,10 @@ static int start_read(const struct device *dev,
				m_data.positive_inputs[channel_id]);
			++active_channels;
		} else {
			nrf_saadc_burst_set(
				NRF_SAADC,
				channel_id,
				NRF_SAADC_BURST_DISABLED);
			nrf_saadc_channel_pos_input_set(
				NRF_SAADC,
				channel_id,