diff --git a/cpu/sam0_common/periph/dac.c b/cpu/sam0_common/periph/dac.c index b333acc601..cd4ea10238 100644 --- a/cpu/sam0_common/periph/dac.c +++ b/cpu/sam0_common/periph/dac.c @@ -128,6 +128,12 @@ int8_t dac_init(dac_t line) DAC->CTRLA.bit.ENABLE = 1; _sync(); +#ifdef DAC_STATUS_READY + /* wait for DAC startup */ + const uint32_t mask = 1 << (DAC_STATUS_READY_Pos + line); + while (!(DAC->STATUS.reg & mask)) {} +#endif + return DAC_OK; }