Skip to content

Commit

Permalink
Merge pull request ARMmbed#478 from bcostm/master
Browse files Browse the repository at this point in the history
[NUCLEO_L152RE] Enable HSI clock for ADC
  • Loading branch information
bogdanm committed Sep 5, 2014
2 parents bd60f75 + f9e7f69 commit 3a31537
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void analogin_init(analogin_t *obj, PinName pin) {
// Get ADC registers structure address
adc = (ADC_TypeDef *)(obj->adc);

// Enable the HSI
RCC_HSICmd(ENABLE);
// Wait until HSI oscillator is ready
while(RCC_GetFlagStatus(RCC_FLAG_HSIRDY) == RESET) {}

// Enable ADC clock
RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);

Expand Down

0 comments on commit 3a31537

Please sign in to comment.