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
Changes to STM32F30x/adc_lld.c
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Changes to STM32F30x/adc_lld.c
Hi,
The first one is definitely an error, thanks for finding. I don't understand the second. why comment out the line 507?
Giovanni
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
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
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
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Changes to STM32F30x/adc_lld.c
Hi,
That action clears the register, strange, GCC should not complain because it is a volatile structure field.
Giovanni
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
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.
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.