Re-use a code

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

cross mob
CrGa_284461
Level 1
Level 1

I wrote a some code for LCD block as a new Custom Char. I wanna re-use this code, but if I insert a new component, when I Build program my personal definition go away. there is a method to save API generated with my personal code?

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

CrGa,

Modifying component code can be tricky and is generally not advisable for the reasons you state.

As Hari indicated, you can create your own LCD component by:

  • Go to the "Components" tab of the Workspace Explorer.
  • Import the Cypress LCD component into your project.
  • Rename the component.
  • Make the modifications you want.

This should prevent your custom component from being updated by the Application Build phase.

If your using the Cypress LCD Character or LCD Segment components, there are GUI tabs to allow you to create custom characters or segment layouts.

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

3 Replies
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi CrGa_284461

Modifying the generated sources will result in PSoC creator overwriting it every time you build as you have mentioned. To make changes to the generated source, you have to import the current component and make a custom version for your application.

You can refer this KBA for details on how to create a custom component: Customizing a Component using PSoC Creator - KBA229139

Please let us know if you have any queries.

Thanks,
Hari

Thank's, for my tests it's a very good wiki.

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

CrGa,

Modifying component code can be tricky and is generally not advisable for the reasons you state.

As Hari indicated, you can create your own LCD component by:

  • Go to the "Components" tab of the Workspace Explorer.
  • Import the Cypress LCD component into your project.
  • Rename the component.
  • Make the modifications you want.

This should prevent your custom component from being updated by the Application Build phase.

If your using the Cypress LCD Character or LCD Segment components, there are GUI tabs to allow you to create custom characters or segment layouts.

Len

Len
"Engineering is an Art. The Art of Compromise."