- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i'm fairly new to cypress PSoC and this is the first component i'm trying to create.
I've setup a parameter for my symbol as a boolean, but now i'd like my API to execute different code depending on it's status.
I've searched through the component author guide and watched some tutorials, but i can't find any reference on how to do this.
any help would be greatly appreciated.
i'm using creator 3.3
best regards,
Damian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the API template file use a
#if(‘$<parameter>‘ == 0) for conditional compilation
or
if (‘$<parameter>‘) for program flow
where <parameter> is the name you have given in the symbol creation dialog.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the API template file use a
#if(‘$<parameter>‘ == 0) for conditional compilation
or
if (‘$<parameter>‘) for program flow
where <parameter> is the name you have given in the symbol creation dialog.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have learnt not to test booleans for true or false. In your examples we were taught to write
#define CASE1 ((`$param1`)&&(`$param2`))
C-language defined false to be zero, so true is defined as being non-zero.
Imagine what the different behaving is, when $param1 has the value of 27 (or any other).
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob and odissey1 this was what i needed to know.
I was using the < and > characters and the ' instead of ` characters.
regards,
Damian