File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,9 @@ static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = {
6565 [NRF_SAADC_AIN6 ] = NRF_PIN_PORT_TO_PIN_NUMBER (4U , 1 ),
6666 [NRF_SAADC_AIN7 ] = NRF_PIN_PORT_TO_PIN_NUMBER (3U , 1 ),
6767 [NRF_SAADC_VDD ] = NRF_SAADC_INPUT_VDD ,
68+ #if defined(NRF_SAADC_INPUT_AVDD )
6869 [NRF_SAADC_AVDD ] = NRF_SAADC_INPUT_AVDD ,
70+ #endif
6971 [NRF_SAADC_DVDD ] = NRF_SAADC_INPUT_DVDD ,
7072};
7173#endif
@@ -231,6 +233,7 @@ static int adc_nrfx_channel_setup(const struct device *dev,
231233 return - EINVAL ;
232234 }
233235
236+ #if NRF_SAADC_HAS_CH_GAIN
234237 switch (channel_cfg -> gain ) {
235238#if defined(SAADC_CH_CONFIG_GAIN_Gain1_6 )
236239 case ADC_GAIN_1_6 :
@@ -284,6 +287,9 @@ static int adc_nrfx_channel_setup(const struct device *dev,
284287 break ;
285288#endif
286289 default :
290+ #else
291+ if (channel_cfg -> gain != ADC_GAIN_1 ) {
292+ #endif /* defined(NRF_SAADC_HAS_CH_GAIN) */
287293 LOG_ERR ("Selected ADC gain is not valid" );
288294 return - EINVAL ;
289295 }
You can’t perform that action at this time.
0 commit comments