Changes to STM32F30x/adc_lld.c

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
skench
Posts: 5
Joined: Wed Apr 03, 2013 2:45 pm

Changes to STM32F30x/adc_lld.c

Post 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
User avatar
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

Post 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
skench
Posts: 5
Joined: Wed Apr 03, 2013 2:45 pm

Re: Changes to STM32F30x/adc_lld.c

Post 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
User avatar
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

Post by Giovanni »

Hi,

That action clears the register, strange, GCC should not complain because it is a volatile structure field.

Giovanni
skench
Posts: 5
Joined: Wed Apr 03, 2013 2:45 pm

Re: Changes to STM32F30x/adc_lld.c

Post 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.
Post Reply