File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,6 @@ void analogin_init(analogin_t *obj, PinName pin) {
77
77
LPC_SYSCON -> SYSAHBCLKCTRL0 |= (1 << 28 );
78
78
}
79
79
80
- // select IRC as asynchronous clock, divided by 1
81
- LPC_SYSCON -> ADCASYNCCLKSEL = 0 ;
82
- LPC_SYSCON -> ADCASYNCCLKDIV = 1 ;
83
-
84
80
__IO LPC_ADC0_Type * adc_reg = (obj -> adc < ADC1_0 ) ? (__IO LPC_ADC0_Type * )(LPC_ADC0 ) : (__IO LPC_ADC0_Type * )(LPC_ADC1 );
85
81
86
82
// determine the system clock divider for a 500kHz ADC clock during calibration
@@ -90,8 +86,8 @@ void analogin_init(analogin_t *obj, PinName pin) {
90
86
adc_reg -> CTRL = (1UL << 30 ) | (clkdiv & 0xFF );
91
87
while ((adc_reg -> CTRL & (1UL << 30 )) != 0 );
92
88
93
- // switch to asynchronous mode
94
- adc_reg -> CTRL = ( 1UL << 8 ) ;
89
+ // Sampling clock: SystemClock divided by 1
90
+ adc_reg -> CTRL = 0 ;
95
91
}
96
92
97
93
static inline uint32_t adc_read (analogin_t * obj ) {
You can’t perform that action at this time.
0 commit comments