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:
parent
8e797e6830
commit
f75430e95f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue