Skip to content

Commit 9864d52

Browse files
author
oclyke
committed
Merge branch 'master' into core-ble
2 parents bd21932 + ab8ed1c commit 9864d52

File tree

7 files changed

+677
-5
lines changed

7 files changed

+677
-5
lines changed

cores/arduino/ard_sup/Arduino.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern "C"
4242
#include "am_bsp.h"
4343

4444
#include "hooks.h"
45+
#include "binary.h"
4546

4647
#include <math.h> //Gets us pow()
4748

cores/arduino/ard_sup/analog/ap3_analog.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ static const uint8_t outcfg_tbl[32][4] =
122122
uint16_t _analogBits = 10; //10-bit by default
123123
uint8_t _analogWriteBits = 8; // 8-bit by default for writes
124124
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
125126

126127
uint16_t analogRead(uint8_t pinNumber)
127128
{
128-
static bool ap3_adc_initialized = false;
129129
if(!ap3_adc_initialized){
130130
ap3_adc_setup();
131131
ap3_adc_initialized = true;
@@ -242,6 +242,7 @@ bool power_adc_disable()
242242
return (false);
243243
}
244244

245+
ap3_adc_initialized = false; // The adc will be reinitialized by the next analogRead
245246
g_ADCHandle = NULL;
246247
return (true);
247248
}

0 commit comments

Comments
 (0)