Enable/Disable Components on Schematic Page via define?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello everybody,

   

is it somehow possible to control the components on the Schematic Page via defines?

   

E.g. for one project I would need some pins to use them for an LED shift register and

   

in another project I would like to use an SPI controlled Touch Display.

   

Can I place both components in my design and enable/disable them via define?

   

Including the generated code, the pin definitions and so on?

   

Thanks and best regards

   

Andreas

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You may only enable/disable the component itself. Then you can use conditional compilation (#ifdef) to generate the code within your project. I tried that and this method works perfectly.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

thanks, I did that too, works fine so far, but a more automatic way would be nice if I have more

   

different projects with different components and a common base code...

   

This is quite similar to comment out each file before a compile instead of using define switches 😉

   

Andreas

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I agree with you But manual commenting parts of your program is more prune for errors than disabling a component on one of the Top Design pages. There are plenty of #defines in the component.h file which you may use in an #ifndef instruction.

   

 

   

Bob

0 Likes

So, there would be no such thing as dynamic reconfiguration in PSoC 3?

   

Regards,

   

George

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

So, there would be no such thing as dynamic reconfiguration in PSoC 3

   

Probably not.

   

You could us a bootloader with two different projects. A bit flash-consuming, but would work when really needed.

   

 

   

Bob

0 Likes