3 Replies Latest reply on Aug 23, 2016 1:41 AM by JoMe_264151

    ISR codes gets lost

      Greetings,

         

      I keep on losing my ISR code wirtten inside CY_ISR(intoncmp_Interrupt) function in intoncmp.c file.  After writing and saving it remains there but when i upload the code or open the file some other time , code vanishes automaticaly.

         

      How can i resolve this issue?

         

       

         

      Thanks

        • 1. Re: ISR codes gets lost
          JoMe_264151

          How can i resolve this issue?

             

          Don't use this way of injecting code into generated files. When they are re-generated they might get overwritten.

             

          There are some clearly marked placed where you may insert declarations or code. Only those areas will survive a re-buld.

             

          There are two other ways to control the code flow for interrupt handlers:

             

          Using the Component_StartEx() API (explained in the component's datasheet)

             

          or using "macro callbacks"  (explained in Creator Help)

             

          I (personally) do not tamper one of the generated .c files (to be quite honest, I rarely do look into them at all). I prefer using StartEx() which allows me to delete from time to time all the generated files (keeping a workspace bundle quite small) and re-generate them at need.

             

           

             

          Bob

          • 2. Re: ISR codes gets lost

            Thank you.

            • 3. Re: ISR codes gets lost
              JoMe_264151

              You are always welcome!

                 

               

                 

              Be creative ;-)

                 

              Bob