- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have noticed there is a disable setting in the Built-in section of components and that it has an fx option. Can this feature be used to include/exclude the component using something like #defines in source?
That would be nice !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is working for me just the other way: I am using an #ifdef and checking for the symbol created in the component's .h file as
found in generated .h
#if !defined(CY_SCB_UART_H)
#define CY_SCB_UART_H
I check for
#ifdef CY_SCB_UART_H
... code for my UART
#endif
I am quite sure that it cannot work the other way by having conditionals in the C source to activate / de-activate components.
The reason is that the fitter (which instanciates the components) is run first, then the code generation step comes and at last the compiler (where your wanted #defines must reside) reads all the stuff.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is working for me just the other way: I am using an #ifdef and checking for the symbol created in the component's .h file as
found in generated .h
#if !defined(CY_SCB_UART_H)
#define CY_SCB_UART_H
I check for
#ifdef CY_SCB_UART_H
... code for my UART
#endif
I am quite sure that it cannot work the other way by having conditionals in the C source to activate / de-activate components.
The reason is that the fitter (which instanciates the components) is run first, then the code generation step comes and at last the compiler (where your wanted #defines must reside) reads all the stuff.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob. I am a bit confused, which should not be much of a surprise. This is from the Component Author Guide:
CY_REMOVE: This parameter is a flag to the elaborator, which tells it to remove the instance
from the netlist. It works in conjunction with the live mux to allow Component
authors to dynamically switch between two different implementations of a
Component in a single schematic. The default value is false (that is, keep the
instance around).
I am trying to grasp its use. What is a "live mux"?
Edit: May be best would be if there is an example project to see it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The term "live mux" probably refers to the "Virtual Mux" components. these can be used to make connections selected at design time using parameters. These virtual muxes do not use any hardware. So you can imagine you are using a SD ADC or an SAR depending on a parameter set. This is something for the component designers.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I got it. I may give it a try one day.
Thank you
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried the virtual mux ! I have been working on this one project, having to set a "1" or a "0" on a wire for tests. I just dropped in a virtual mux and fed it with a "1" on pin 1 and a "0" on pin 0. Then I can just click on the component and select the one I want. Trivial but cool !