We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e445e08 commit 6b6d072Copy full SHA for 6b6d072
targets/TARGET_TOSHIBA/TARGET_TMPM066/analogin_api.c
@@ -18,6 +18,7 @@
18
#include "pinmap.h"
19
#include "mbed_wait_api.h"
20
21
+static uint8_t adc_reset_init = 0; // Is ADC Reset happened yet?
22
#define ADC_10BIT_RANGE 0x3FF
23
24
static const PinMap PinMap_ADC[] = {
@@ -43,8 +44,11 @@ void analogin_init(analogin_t *obj, PinName pin)
43
44
CG_SetADCClkSupply(ENABLE);
45
// Set pin function as ADC
46
pinmap_pinout(pin, PinMap_ADC);
- // Software reset ADC
47
- ADC_SWReset();
+ if (!adc_reset_init) {
48
+ // Software reset ADC
49
+ ADC_SWReset();
50
+ adc_reset_init = 1;
51
+ }
52
// Set sample hold time and pre-scale clock
53
ADC_SetClk(ADC_CONVERSION_81_CLOCK, ADC_FC_DIVIDE_LEVEL_8);
54
// Set input channel
0 commit comments