PSoC Creator 4.4 - How to insert template function headers?

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

cross mob
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

Hi

Using PSoC Creator V4.4. How can I insert my company's standard function headers and comment blocks? I have searched but cannot find anything in the published information. There is a Cypress video (less than 1 minute long) but it does not explain how to create or where to put a snippet.

Thanks in advance, SImon

1 Solution

Hi @SimonCanada,

So it appears that you cannot add new top-level folders but you can add subfolders. Please follow the below process.

So if I go to the c directory in the snippets directory and create a new directory:

Gautami_12_0-1651149029934.png

And then create a file under that directory:

Gautami_12_1-1651149057549.png

And then I change the snippet to do what I want:

Gautami_12_2-1651149092961.png

I can then close and reopen PSoC Creator (as snippets are loaded at startup.)If I then open a project and go to a c code file, and select insert snippet I see this under c:

Gautami_12_3-1651149147136.pngGautami_12_4-1651149162291.png

And it inserts like:

Gautami_12_5-1651149194711.png

please try this .

Warm Regards,
Gautami J

View solution in original post

7 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Simon,

Can you provide a link to a Cypress video you refered above?

0 Likes
SimonCanada
Level 3
Level 3
25 replies posted 10 questions asked 50 sign-ins

https://www.youtube.com/watch?v=FIGeEAMg-tQ

This old video says what can be done but not how to do it.

0 Likes

Hello.

I've not tried this, but I think it's what you're looking for.
Solved: Snippet and template support in PSoC creator 4.3 - Infineon Developer Community

Look in Creator User Guide for My Templates.

0 Likes

Hi

No, as that article explains, My Templates is for Template Applications, not for snippets. I am looking for some level of documentation for snippets. I had found and read that article before posting here: I had even less luck that that poster.

It appears that the guy putting the question in that article found, just as I did, that PSoC Creator keeps its snippets in C:\Program Files (x86)\Cypress\PSoC Creator\4.4\PSoC Creator\conf\snippets in sub-folders like "c", "ble" etc. However, simply adding new physical folders then restarting PSoC Creator does not make the new folder appear on the Edit | Snippets context menu.

One of my colleagues did succeed in making a Doxygen function header that worked just be adding to the C folder, but he found that PSoC Creator seems very fussy so the snippet is easily broken if changed. I tried various things but never got one to work even when I could get it to appear on the context menu or respond to tab-tab.

Kind regards, Simon

0 Likes

Hi @SimonCanada,

So it appears that you cannot add new top-level folders but you can add subfolders. Please follow the below process.

So if I go to the c directory in the snippets directory and create a new directory:

Gautami_12_0-1651149029934.png

And then create a file under that directory:

Gautami_12_1-1651149057549.png

And then I change the snippet to do what I want:

Gautami_12_2-1651149092961.png

I can then close and reopen PSoC Creator (as snippets are loaded at startup.)If I then open a project and go to a c code file, and select insert snippet I see this under c:

Gautami_12_3-1651149147136.pngGautami_12_4-1651149162291.png

And it inserts like:

Gautami_12_5-1651149194711.png

please try this .

Warm Regards,
Gautami J

Thanks

As I said, a minor error in the implementation will confuse PSoC Creator and it will refuse to display. But I accept your explanation is as good as it is going to get with the current software.

Thanks, Simon

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @SimonCanada

Glad your query has been resolved.

Please feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help.

Warm Regards,
Gautami J

0 Likes