Skip to content

Commit 52752f3

Browse files
committed
Cleaned up analogOversampling()
Removed unneeded code
1 parent 92b6381 commit 52752f3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extern "C" {
3131
static uint32_t saadcReference = SAADC_CH_CONFIG_REFSEL_Internal;
3232
static uint32_t saadcGain = SAADC_CH_CONFIG_GAIN_Gain1_6;
3333

34-
static uint32_t saadcOversampling = SAADC_OVERSAMPLE_OVERSAMPLE_Bypass;
3534
static bool saadcBurst = SAADC_CH_CONFIG_BURST_Disabled;
3635

3736
#if 0 // Note: Adafruit use seperated HardwarePWM class
@@ -129,8 +128,7 @@ void analogReference( eAnalogReference ulMode )
129128

130129
void analogOversampling( uint32_t ulOversampling )
131130
{
132-
if(ulOversampling > 0) saadcBurst = SAADC_CH_CONFIG_BURST_Enabled; // burst mode has to be enable to use oversampling
133-
else saadcBurst = SAADC_CH_CONFIG_BURST_Disabled;
131+
saadcBurst = SAADC_CH_CONFIG_BURST_Enabled;
134132

135133
switch (ulOversampling) {
136134
case 0:
@@ -164,8 +162,6 @@ void analogOversampling( uint32_t ulOversampling )
164162
NRF_SAADC->OVERSAMPLE = SAADC_OVERSAMPLE_OVERSAMPLE_Over256x;
165163
break;
166164
}
167-
168-
saadcBurst = SAADC_CH_CONFIG_BURST_Enabled;
169165
}
170166

171167
uint32_t analogRead( uint32_t ulPin )

0 commit comments

Comments
 (0)