cancel
Showing results for 
Search instead for 
Did you mean: 

SW TRIGGER wrong logic check in HAL_DAC_START - STM32L4 HAL

AMatu
Associate
    /* Check if software trigger enabled */
    if ((hdac->Instance->CR & (DAC_CR_TEN1 | DAC_CR_TSEL1)) == DAC_CR_TEN1)

I think the if check is wrong - we should check if TEN and TSEL are set, but now we check for TSEL=111 and TEN=0

2 REPLIES 2
Piranha
Chief II

Currently it checks for exactly the opposite: TEN=1 and TSEL1=0. Supposedly it is the line 590 of the HAL driver code. The line 599 is also wrong. And the correct solution seems to be like the line 611. Also the block of code at the line 611 could be merged with the block at line 590 if...

Edited by moderating team to adhere to community guidelines

AMatu
Associate

Yup. Apparently noone ever used HAL for SW trigger (it makes sense when you want to use TRIANGLE or NOISE generation without HW trigger).