Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions drivers/adc/adc_nrfx_saadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
[NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
[NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
[NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD,
#if defined(NRF_SAADC_INPUT_AVDD)

Check notice on line 68 in drivers/adc/adc_nrfx_saadc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/adc/adc_nrfx_saadc.c:68 - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD,
[NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD,
#endif
[NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD,
};
#endif
Expand Down Expand Up @@ -220,7 +222,9 @@
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
#endif
#if NRF_SAADC_HAS_CH_BURST
.burst = NRF_SAADC_BURST_DISABLED,
#endif

Check notice on line 227 in drivers/adc/adc_nrfx_saadc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/adc/adc_nrfx_saadc.c:227 - .resistor_p = NRF_SAADC_RESISTOR_DISABLED, - .resistor_n = NRF_SAADC_RESISTOR_DISABLED, + .resistor_p = NRF_SAADC_RESISTOR_DISABLED, + .resistor_n = NRF_SAADC_RESISTOR_DISABLED, #endif #if NRF_SAADC_HAS_CH_BURST - .burst = NRF_SAADC_BURST_DISABLED, + .burst = NRF_SAADC_BURST_DISABLED,
};
uint8_t channel_id = channel_cfg->channel_id;
uint32_t input_negative = channel_cfg->input_negative;
Expand All @@ -229,6 +233,7 @@
return -EINVAL;
}

#if NRF_SAADC_HAS_CH_GAIN
switch (channel_cfg->gain) {
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_6)
case ADC_GAIN_1_6:
Expand Down Expand Up @@ -282,6 +287,9 @@
break;
#endif
default:
#else
if (channel_cfg->gain != ADC_GAIN_1) {
#endif /* defined(NRF_SAADC_HAS_CH_GAIN) */
LOG_ERR("Selected ADC gain is not valid");
return -EINVAL;
}
Expand Down Expand Up @@ -530,6 +538,7 @@
uint8_t resolution = sequence->resolution;
uint8_t active_channels;
uint8_t channel_id;
nrf_saadc_burst_t burst;

/* Signal an error if channel selection is invalid (no channels or
* a non-existing one is selected).
Expand Down Expand Up @@ -581,10 +590,13 @@
* is not used (hence, the multiple channel sampling is
* possible), the burst mode have to be deactivated.
*/
nrf_saadc_burst_set(NRF_SAADC, channel_id,
(sequence->oversampling != 0U ?
NRF_SAADC_BURST_ENABLED :
NRF_SAADC_BURST_DISABLED));
burst = (sequence->oversampling != 0U ?
NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED);
#if NRF_SAADC_HAS_CH_BURST

Check notice on line 595 in drivers/adc/adc_nrfx_saadc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/adc/adc_nrfx_saadc.c:595 - burst = (sequence->oversampling != 0U ? - NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED); + burst = (sequence->oversampling != 0U ? NRF_SAADC_BURST_ENABLED + : NRF_SAADC_BURST_DISABLED);
nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst);
#else
nrf_saadc_burst_set(NRF_SAADC, burst);
#endif
nrf_saadc_channel_pos_input_set(
NRF_SAADC,
channel_id,
Expand All @@ -596,10 +608,12 @@
);
++active_channels;
} else {
nrf_saadc_burst_set(
NRF_SAADC,
channel_id,
NRF_SAADC_BURST_DISABLED);
burst = NRF_SAADC_BURST_DISABLED;
#if NRF_SAADC_HAS_CH_BURST
nrf_saadc_channel_burst_set(NRF_SAADC, channel_id, burst);
#else
nrf_saadc_burst_set(NRF_SAADC, burst);
#endif
nrf_saadc_channel_pos_input_set(
NRF_SAADC,
channel_id,
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ manifest:
groups:
- hal
- name: hal_nordic
revision: 4eafaa44a55a557595e529f8cbdfc8dc1248da36
revision: 1f169d927e367eb1e161972e9504da5aa1f10c42
path: modules/hal/nordic
groups:
- hal
Expand Down
Loading