From 6e244314c053037879b6c3c532e4bd8cded84db0 Mon Sep 17 00:00:00 2001 From: Christopher Stawarz Date: Tue, 19 Nov 2019 10:40:04 -0500 Subject: [PATCH] Restore DAC write resolution scaling for SAMD21 boards This reverts commit c7fa463c0d5586e010eeab57220200fd9fe27a73. --- cores/arduino/wiring_analog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index 13a0191b0..9134315fa 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -415,10 +415,9 @@ void analogWrite(uint32_t pin, uint32_t value) if (pin == PIN_DAC0) { // Only 1 DAC on A0 (PA02) #endif -#if defined(__SAMD51__) - - value = mapResolution(value, _writeResolution, _dacResolution); + value = mapResolution(value, _writeResolution, _dacResolution); +#if defined(__SAMD51__) uint8_t channel = (pin == PIN_DAC0 ? 0 : 1);