@@ -220,7 +220,9 @@ static int adc_nrfx_channel_setup(const struct device *dev,
220
220
.resistor_p = NRF_SAADC_RESISTOR_DISABLED ,
221
221
.resistor_n = NRF_SAADC_RESISTOR_DISABLED ,
222
222
#endif
223
+ #if NRF_SAADC_HAS_CH_BURST
223
224
.burst = NRF_SAADC_BURST_DISABLED ,
225
+ #endif
224
226
};
225
227
uint8_t channel_id = channel_cfg -> channel_id ;
226
228
uint32_t input_negative = channel_cfg -> input_negative ;
@@ -530,6 +532,7 @@ static int start_read(const struct device *dev,
530
532
uint8_t resolution = sequence -> resolution ;
531
533
uint8_t active_channels ;
532
534
uint8_t channel_id ;
535
+ nrf_saadc_burst_t burst ;
533
536
534
537
/* Signal an error if channel selection is invalid (no channels or
535
538
* a non-existing one is selected).
@@ -581,10 +584,13 @@ static int start_read(const struct device *dev,
581
584
* is not used (hence, the multiple channel sampling is
582
585
* possible), the burst mode have to be deactivated.
583
586
*/
584
- nrf_saadc_burst_set (NRF_SAADC , channel_id ,
585
- (sequence -> oversampling != 0U ?
586
- NRF_SAADC_BURST_ENABLED :
587
- NRF_SAADC_BURST_DISABLED ));
587
+ burst = (sequence -> oversampling != 0U ?
588
+ NRF_SAADC_BURST_ENABLED : NRF_SAADC_BURST_DISABLED );
589
+ #if NRF_SAADC_HAS_CH_BURST
590
+ nrf_saadc_channel_burst_set (NRF_SAADC , channel_id , burst );
591
+ #else
592
+ nrf_saadc_burst_set (NRF_SAADC , burst );
593
+ #endif
588
594
nrf_saadc_channel_pos_input_set (
589
595
NRF_SAADC ,
590
596
channel_id ,
@@ -596,10 +602,12 @@ static int start_read(const struct device *dev,
596
602
);
597
603
++ active_channels ;
598
604
} else {
599
- nrf_saadc_burst_set (
600
- NRF_SAADC ,
601
- channel_id ,
602
- NRF_SAADC_BURST_DISABLED );
605
+ burst = NRF_SAADC_BURST_DISABLED ;
606
+ #if NRF_SAADC_HAS_CH_BURST
607
+ nrf_saadc_channel_burst_set (NRF_SAADC , channel_id , burst );
608
+ #else
609
+ nrf_saadc_burst_set (NRF_SAADC , burst );
610
+ #endif
603
611
nrf_saadc_channel_pos_input_set (
604
612
NRF_SAADC ,
605
613
channel_id ,
0 commit comments