Avoiding changes in the source file to get overwritten in PSoC Creator

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

cross mob
JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

The Cypress USBFS component doesn't have enough custom code sections in it to customize handling all the different requests that USB can make.  I can modify the Generated_Source files, but then those changes get overwritten every time I build the project, and I have to restore the modifications from version control.

I see from https://community.cypress.com/docs/DOC-12381 that we should be able to modify the original source code for the component, which should let us add our own custom code sections where necessary, but when I try this, I get a C# error in file cyaudio2_0.cs, and I know nothing about C#:

The type or namespace name 'ArrayEditor' does not exist in the namespace 'System.ComponentModel.Design' (are you missing an assembly reference?)

Any idea what I need to do to customize this code?

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I suggest to make your own component out of USBFS, by lmporting it into the project an renaming. Then it can be modified as needed. Unfortunately, the USBFS is a big component, and that won't be an easy task.

/odissey1

View solution in original post

2 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Please use Skip Code Generation Option in Creator to prevent your changes from being overwritten.

Right click on your project > Build Settings > Skip Code Generation = True

You can make modifications to the source code of the component but it requires prior knowledge of C# and I would not recommend changing anything if you aren't familiar with it. You can refer to "Component Author Guide" present under Help > Documentation.

Regards,

Dheeraj

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I suggest to make your own component out of USBFS, by lmporting it into the project an renaming. Then it can be modified as needed. Unfortunately, the USBFS is a big component, and that won't be an easy task.

/odissey1