File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
cores/arduino/ard_sup/analog Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,10 @@ static const uint8_t outcfg_tbl[32][4] =
122
122
uint16_t _analogBits = 10 ; // 10-bit by default
123
123
uint8_t _analogWriteBits = 8 ; // 8-bit by default for writes
124
124
uint8_t _servoWriteBits = 8 ; // 8-bit by default for writes
125
+ static bool ap3_adc_initialized = false ; // flag to show if the ADC has been initialized
125
126
126
127
uint16_t analogRead (uint8_t pinNumber)
127
128
{
128
- static bool ap3_adc_initialized = false ;
129
129
if (!ap3_adc_initialized){
130
130
ap3_adc_setup ();
131
131
ap3_adc_initialized = true ;
@@ -242,6 +242,7 @@ bool power_adc_disable()
242
242
return (false );
243
243
}
244
244
245
+ ap3_adc_initialized = false ; // The adc will be reinitialized by the next analogRead
245
246
g_ADCHandle = NULL ;
246
247
return (true );
247
248
}
You can’t perform that action at this time.
0 commit comments