From dfe73a063d5a38745e314120ce1b28008b719481 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 5 Nov 2019 10:50:57 -0500 Subject: [PATCH] Fix error that would carry past python exception --- ports/stm32f4/common-hal/analogio/AnalogOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32f4/common-hal/analogio/AnalogOut.c b/ports/stm32f4/common-hal/analogio/AnalogOut.c index f38c86274e..79ced0492f 100644 --- a/ports/stm32f4/common-hal/analogio/AnalogOut.c +++ b/ports/stm32f4/common-hal/analogio/AnalogOut.c @@ -60,7 +60,6 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, } else { mp_raise_ValueError(translate("Invalid DAC pin supplied")); } - dac_on[self->dac_index] = true; //Only init if the shared DAC is empty or reset if (handle.Instance == NULL || handle.State == HAL_DAC_STATE_RESET) { @@ -85,6 +84,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, mp_raise_ValueError(translate("DAC Channel Init Error")); } + dac_on[self->dac_index] = true; self->pin = pin; claim_pin(pin); #endif