Fix for STM32F0xx StdPeriph Lib
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-07-21 6:54 AM
Posted on July 21, 2014 at 15:54
Hello,
I just ran into a trap with STM32F0xx_StdPeriph_Lib_V1.3.1 and have a suggestion for a fix. In function ADC_ChannelConfig() of file stm32f0xx_adc.c, the line 724ADCx->CHSELR |= (uint32_t)ADC_Channel;
activates the selected channel. Previously selected channels remain selected. In my opinion this behaviour is misleading, also considering the function documentation header. Furthermore there is no function to de-select the previously selected channels, so I have to break with hardware abstraction in my code and clear CHSEL manually.
My suggestion is to change line 724 to
ADCx->CHSELR = (uint32_t)ADC_Channel;
which actually configures the selection passed by parameter without having a ''memory effect''.
This is already changed in Cube FW, so it would also be consistent with it.
Oliver
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-01-26 7:40 AM
Posted on January 26, 2015 at 16:40
Hi Oliver,
Thanks for the valuable feedback. I've logged your fix suggestion under the STM32 SPL F0 bugs list. Keep an eye for next updates.Regards,Heisenberg.