You are here

pass variable | Cypress Semiconductor

pass variable

Summary: 2 Replies, Latest post by U2 on 28 Feb 2012 03:02 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
gkavin's picture
User
27 posts

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

U2
uday's picture
Cypress Employee
569 posts

 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. 

U2
uday's picture
Cypress Employee
569 posts

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

/* `#START RTC_ISR_DEFINITION` */

 

/* `#END` */

Log in to post new comments.