diff --git a/src/atsamd/adc.c b/src/atsamd/adc.c index 8f23e9cb..26465c2d 100644 --- a/src/atsamd/adc.c +++ b/src/atsamd/adc.c @@ -21,7 +21,8 @@ static const uint8_t adc_pins[] = { }; #elif CONFIG_MACH_SAMD51 -#define SAMD51_ADC_SYNC(ADC, BIT) while(ADC->SYNCBUSY.reg & ADC_SYNCBUSY_ ## BIT) +#define SAMD51_ADC_SYNC(ADC, BIT) \ + while(ADC->SYNCBUSY.reg & ADC_SYNCBUSY_ ## BIT) static const uint8_t adc_pins[] = { /* ADC0 */ GPIO('A', 2), GPIO('A', 3), GPIO('B', 8), GPIO('B', 9), GPIO('A', 4), @@ -108,14 +109,16 @@ adc_init(void) while(ADC0->SYNCBUSY.reg & ADC_SYNCBUSY_REFCTRL); ADC0->SAMPCTRL.reg = ADC_SAMPCTRL_SAMPLEN(63); while (ADC0->SYNCBUSY.reg & ADC_SYNCBUSY_SAMPCTRL); - ADC0->CTRLA.reg = ADC_CTRLA_PRESCALER(ADC_CTRLA_PRESCALER_DIV32_Val) | ADC_CTRLA_ENABLE; + ADC0->CTRLA.reg = (ADC_CTRLA_PRESCALER(ADC_CTRLA_PRESCALER_DIV32_Val) + | ADC_CTRLA_ENABLE); // ADC1 ADC1->REFCTRL.reg = ADC_REFCTRL_REFSEL_INTVCC1; while(ADC1->SYNCBUSY.reg & ADC_SYNCBUSY_REFCTRL); ADC1->SAMPCTRL.reg = ADC_SAMPCTRL_SAMPLEN(63); while(ADC1->SYNCBUSY.reg & ADC_SYNCBUSY_SAMPCTRL); - ADC1->CTRLA.reg = ADC_CTRLA_PRESCALER(ADC_CTRLA_PRESCALER_DIV32_Val) | ADC_CTRLA_ENABLE; + ADC1->CTRLA.reg = (ADC_CTRLA_PRESCALER(ADC_CTRLA_PRESCALER_DIV32_Val) + | ADC_CTRLA_ENABLE); #endif }