7 Replies Latest reply on Dec 28, 2014 12:36 PM by user_6153427

    generated files

    user_6153427
              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?   
        • 1. Re: generated files
          user_302397898

           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?

          • 2. Re: generated files
            user_6153427
                    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.   
            • 3. Re: generated files
              user_1377889

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

                 

               

                 

              Bob

              • 4. Re: generated files
                user_6153427
                        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"?   
                • 5. Re: generated files
                  user_1377889

                  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

                  • 6. Re: generated files
                    user_1377889

                    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

                    • 7. Re: generated files
                      user_6153427
                              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.