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] = {
65
65
[NRF_SAADC_AIN6 ] = NRF_PIN_PORT_TO_PIN_NUMBER (4U , 1 ),
66
66
[NRF_SAADC_AIN7 ] = NRF_PIN_PORT_TO_PIN_NUMBER (3U , 1 ),
67
67
[NRF_SAADC_VDD ] = NRF_SAADC_INPUT_VDD ,
68
+ #if defined(NRF_SAADC_INPUT_AVDD )
68
69
[NRF_SAADC_AVDD ] = NRF_SAADC_INPUT_AVDD ,
70
+ #endif
69
71
[NRF_SAADC_DVDD ] = NRF_SAADC_INPUT_DVDD ,
70
72
};
71
73
#endif
@@ -231,6 +233,7 @@ static int adc_nrfx_channel_setup(const struct device *dev,
231
233
return - EINVAL ;
232
234
}
233
235
236
+ #if NRF_SAADC_HAS_CH_GAIN
234
237
switch (channel_cfg -> gain ) {
235
238
#if defined(SAADC_CH_CONFIG_GAIN_Gain1_6 )
236
239
case ADC_GAIN_1_6 :
@@ -284,6 +287,9 @@ static int adc_nrfx_channel_setup(const struct device *dev,
284
287
break ;
285
288
#endif
286
289
default :
290
+ #else
291
+ if (channel_cfg -> gain != ADC_GAIN_1 ) {
292
+ #endif /* defined(NRF_SAADC_HAS_CH_GAIN) */
287
293
LOG_ERR ("Selected ADC gain is not valid" );
288
294
return - EINVAL ;
289
295
}
You can’t perform that action at this time.
0 commit comments