stmhal: Fix write_timed function for DAC(2).

Addresses issue #617.
This commit is contained in:
Damien George 2014-05-19 18:58:53 +01:00
parent f905ebb173
commit 2de4d59171
1 changed files with 5 additions and 1 deletions

View File

@ -295,7 +295,11 @@ mp_obj_t pyb_dac_write_timed(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
DMA_Handle.Init.PeriphBurst = DMA_PBURST_SINGLE;
HAL_DMA_Init(&DMA_Handle);
__HAL_LINKDMA(&DAC_Handle, DMA_Handle1, DMA_Handle);
if (self->dac_channel == DAC_CHANNEL_1) {
__HAL_LINKDMA(&DAC_Handle, DMA_Handle1, DMA_Handle);
} else {
__HAL_LINKDMA(&DAC_Handle, DMA_Handle2, DMA_Handle);
}
DAC_Handle.Instance = DAC;
DAC_Handle.State = HAL_DAC_STATE_RESET;