diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-01-19 11:42:33 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-01-19 11:42:33 -0800 |
| commit | dad33e6ad035a36aa676f44987225eac39d69ac0 (patch) | |
| tree | b28d528405c5959c6c79e026f628487db8040999 /atmel-samd/main.c | |
| parent | f74e47796647190d32303553d05472545402a871 (diff) | |
atmel-samd: Reset the DAC on soft reset. Fixes #80.
Diffstat (limited to 'atmel-samd/main.c')
| -rw-r--r-- | atmel-samd/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/atmel-samd/main.c b/atmel-samd/main.c index e224f1add..336b08b57 100644 --- a/atmel-samd/main.c +++ b/atmel-samd/main.c @@ -161,6 +161,10 @@ void reset_samd21(void) { analogin_reset(); + // Wait for the DAC to sync. + while (DAC->STATUS.reg & DAC_STATUS_SYNCBUSY) {} + DAC->CTRLA.reg |= DAC_CTRLA_SWRST; + struct system_pinmux_config config; system_pinmux_get_config_defaults(&config); config.powersave = true; |
