From f75430e95f557e4e77db1d9131417fa82e694aa6 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 1 Jan 2017 22:10:24 -0500 Subject: [PATCH] gpio: Fix sam38xe ADC startup check The status register needs to be inspected, not the enable register. Signed-off-by: Kevin O'Connor --- src/sam3x8e/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sam3x8e/gpio.c b/src/sam3x8e/gpio.c index 5445c397..ab7853c2 100644 --- a/src/sam3x8e/gpio.c +++ b/src/sam3x8e/gpio.c @@ -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;