Skip to content

Commit dfe73a0

Browse files
committed
Fix error that would carry past python exception
1 parent 38e38b9 commit dfe73a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/stm32f4/common-hal/analogio/AnalogOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self,
6060
} else {
6161
mp_raise_ValueError(translate("Invalid DAC pin supplied"));
6262
}
63-
dac_on[self->dac_index] = true;
6463

6564
//Only init if the shared DAC is empty or reset
6665
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,
8584
mp_raise_ValueError(translate("DAC Channel Init Error"));
8685
}
8786

87+
dac_on[self->dac_index] = true;
8888
self->pin = pin;
8989
claim_pin(pin);
9090
#endif

0 commit comments

Comments
 (0)