Fix error that would carry past python exception

This commit is contained in:
Hierophect 2019-11-05 10:50:57 -05:00
parent 38e38b9f8d
commit dfe73a063d
1 changed files with 1 additions and 1 deletions

View File

@ -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