I want merge ADC(main) with I2C(main)

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

Moderator: RoccoMarco

Post Reply
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

I want merge ADC(main) with I2C(main)

Post by Pask »

I have chibistudio. It has many chibios example ready to run. I want "merge" main file of ADC example Project with main of I2C example project. I want just a single main with both function (I2C and ADC) but when i copy I2C main project's istructions to ADC main i have many errors (many constant and function unresolved)
Why?

Thanks.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I want merge ADC(main) with I2C(main)

Post by Giovanni »

Hi,

Look at the halconf.h and mcuconf.h files, there you can enable and disable the various drivers. If you add I2C to the ADC demo then you have to enable I2C driver in halconf.h and the I2C unit in mcuconf.h.

Giovanni
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: I want merge ADC(main) with I2C(main)

Post by Pask »

thanks a lot but don't seem to work.
I modified the following define from false to true in the ADC's mcuconf.h because i compared both mcuconf.h files (ADC and I2C)
and i found this dirrefernces

#define STM32_I2C_USE_I2C1 TRUE
#define STM32_I2C_USE_I2C2 TRUE
#define STM32_I2C_USE_I2C3 TRUE

#define STM32_SERIAL_USE_USART2 TRUE
Pask
Posts: 47
Joined: Thu Jun 19, 2014 3:51 pm

Re: I want merge ADC(main) with I2C(main)

Post by Pask »

Sorry. I modified halconf.h also.
Problem resolved.
Thanks so much Giovanni ;-)
Post Reply