Skip to content

Commit 820066d

Browse files
committed
[sg fromlist] saadc: disable configured channels after sampling
Save power by disabling configured channels after a sampling task has finished its work. This happened previously and is crucial for battery powered applications. Upstream PR: NordicSemiconductor/nrfx#138 Signed-off-by: Christoph Mair <christoph.mair@husqvarnagroup.com>
1 parent 9e1bc32 commit 820066d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nrfx/drivers/src/nrfx_saadc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ static void saadc_event_end_handle(void)
849849
{
850850
case NRF_SAADC_STATE_SIMPLE_MODE_SAMPLE:
851851
nrfy_saadc_disable(NRF_SAADC);
852+
saadc_channels_disable(m_cb.channels_configured | m_cb.channels_activated);
852853
m_cb.saadc_state = NRF_SAADC_STATE_SIMPLE_MODE;
853854
/* In the simple, non-blocking mode the event handler must be
854855
* called after the internal driver state is updated. This will
@@ -868,6 +869,7 @@ static void saadc_event_end_handle(void)
868869
if (!m_cb.buffer_primary.p_buffer)
869870
{
870871
nrfy_saadc_disable(NRF_SAADC);
872+
saadc_channels_disable(m_cb.channels_configured | m_cb.channels_activated);
871873
m_cb.saadc_state = NRF_SAADC_STATE_ADV_MODE;
872874
evt_data.type = NRFX_SAADC_EVT_FINISHED;
873875
m_cb.event_handler(&evt_data);

0 commit comments

Comments
 (0)