gpio: Fix sam38xe ADC startup check

The status register needs to be inspected, not the enable register.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-01-01 22:10:24 -05:00
parent 8e797e6830
commit f75430e95f
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ gpio_adc_setup(uint8_t pin)
if (adc_pins[chan] != pin)
continue;
// Found PIN
if (!(PMC->PMC_PCER1 & (1 << (ID_ADC-32)))) {
if (!(PMC->PMC_PCSR1 & (1 << (ID_ADC-32)))) {
// Setup ADC
PMC->PMC_PCER1 = 1 << (ID_ADC-32);
uint32_t prescal = SystemCoreClock / (2 * ADC_FREQ_MAX) - 1;