diff --git a/cpu/stm32/periph/adc_l1.c b/cpu/stm32/periph/adc_l1.c index 93473f47c3cab..eeab76d997532 100644 --- a/cpu/stm32/periph/adc_l1.c +++ b/cpu/stm32/periph/adc_l1.c @@ -156,12 +156,12 @@ int32_t adc_sample(adc_t line, adc_res_t res) prep(); /* mask and set resolution, conversion channel and single read */ - ADC1->CR1 = (ADC1->CR1 & ~ADC_CR1_RES_Msk) | (res & ADC_CR1_RES_Msk); + ADC1->CR1 = (ADC1->CR1 & ~ADC_CR1_RES) | (res & ADC_CR1_RES); ADC1->SQR1 &= ~ADC_SQR1_L; ADC1->SQR5 = adc_config[line].chan; /* only set ADON when ADONS bit is cleared (ADC not ready) */ - if (!(ADC1->SR & ADC_SR_ADONS_Msk)) { + if (!(ADC1->SR & ADC_SR_ADONS)) { ADC1->CR2 |= ADC_CR2_ADON; } @@ -176,7 +176,7 @@ int32_t adc_sample(adc_t line, adc_res_t res) /* wait for ADC to become ready before disabling it */ while (!(ADC1->SR & ADC_SR_ADONS)) {} - ADC1->CR2 &= ~ADC_CR2_ADON_Msk; + ADC1->CR2 &= ~ADC_CR2_ADON; /* power off and unlock device again */ done();