2 Replies Latest reply on Feb 28, 2012 3:02 AM by udayan.umapathi

    pass variable

    gopalakrishnan.varadappan

      I used a RTC in PSoC3.

         

      i defined a variable in main.c. i want to use the value of the variable in the RTC_INT.c . Let me know how to pass such a variable from main.c to RTC_INT.c file

         

      regards

         

      kavin

        • 1. Re: pass variable
          udayan.umapathi

           Declare your variable in main.c. Since you need to access this from an place external to main.c, you need to again declare this variable with the EXTERN ketword in the file where you are trying to acess it. In this case, it is RTC_INT.c . But then RTC_INT.c is a file regenrated by PSoC Creator when you do a clean build. In order to inform creator to hold this declaration between builds, you need to declare the variable in a specific place. 

          • 2. Re: pass variable
            udayan.umapathi

             The specific place where you need to put your extern definition in RTC_INT.c would be between 

               

             

               

            /* `#START RTC_ISR_DEFINITION` */

               

             

               

            /* `#END` */