generated files

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

cross mob
KeYp_290406
Level 4
Level 4
        If I modify one of the generated c files for a component, is there a way to lock the file so that it won't be overwritten the next time I rebuild?   
0 Likes
7 Replies
JeCo_264681
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

 That file will be over written the next clean & build. Please share the parameters or code you are trying to modify. Perhaps you can create your own header file (with the #include) and accomplish the desired result?

0 Likes
KeYp_290406
Level 4
Level 4
        You are probably correct in that all I have to do is copy the modified function to a different location. I thought maybe there is a way to make changes permanent. All I did was slightly modify the init function in the LCD component to support a display I was using.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You may use the configuration dialog of the component and under the "Built-in"-tab switch on the "Cy_Suppress_API_Gen" property.

   

 

   

Bob

0 Likes
KeYp_290406
Level 4
Level 4
        If I suppress that, the component's API file is removed when I do a new clean and build. I'm only trying to preserve changes to the API. How does Creator allow modification to some of the component APIs as when they show "add your code here"?   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There are dedicated ponts within the code, clearly marked.

   

Take this as an example

   

CY_ISR(ADC_SAR_Seq_1_IRQ_Interrupt)
{
    /*  Place your Interrupt code here. */
    /* `#START ADC_SAR_Seq_1_IRQ_Interrupt` */

    /* `#END` */
}
 

   

I have not found yet a hint in Cypress's documentation whether the /* '# lead-in can be used to permanently change APIs.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Additionally: the generated API-files are not deleted, only removed from project. You may add them manually back again and they will be treated like your own files.

   

 

   

Bob

0 Likes
KeYp_290406
Level 4
Level 4
        I only needed a new init function so I put it in with my files. I also had to copy one low level function that wasn't exposed by the API. I've always wondered how they are able to protect those areas of the API that allow user code to be added.   
0 Likes