Page 1 of 1
Changes to STM32F30x/adc_lld.c
Posted: Fri May 24, 2013 12:09 pm
by skench
Hi all
To successfully use both ADC1 and ADC3 I have had to make a couple of changes to the STM32F30x/adc_lld.c file, see the diff below.
345c345
< adcObjectInit(&ADCD3);
---
> adcObjectInit(&ADCD1);
507c507
< // adcp->adcm->ISR = adcp->adcm->ISR;
---
> adcp->adcm->ISR = adcp->adcm->ISR;
Best Regards
Stephen Kench
Re: Changes to STM32F30x/adc_lld.c
Posted: Fri May 24, 2013 5:38 pm
by Giovanni
Hi,
The first one is definitely an error, thanks for finding. I don't understand the second. why comment out the line 507?
Giovanni
Re: Changes to STM32F30x/adc_lld.c
Posted: Mon May 27, 2013 6:54 pm
by skench
Hi Giovanni
GCC complains that the line is a null statement but to be honest I have not checked if it's necessary to write the same contents to the ISR register.
Many have said it before but it has got to be said again "congratulations on a supper piece of work"!
Stephen Kench
Re: Changes to STM32F30x/adc_lld.c
Posted: Mon May 27, 2013 7:17 pm
by Giovanni
Hi,
That action clears the register, strange, GCC should not complain because it is a volatile structure field.
Giovanni
Re: Changes to STM32F30x/adc_lld.c
Posted: Tue May 28, 2013 10:30 am
by skench
Hi,
GCC complains with "Assignment to itself 'adcp->adcm->ISR = adcp->adcm->ISR'"
It seems that this warning is just from the static syntax checker and that the actual compile does not generate a error.
Therefore I have return the line to it's original state and I will disregard the warning.
I am using the Linux gcc version 4.7.3 20130312.
Thanks again.