How to use the parameters in PSoC Creator

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

cross mob
SaWa_284216
Level 4
Level 4

Okay so I keep seeing all these capital letter definitions or whatever they are called and I don't know how to use them..

   

things like STATUS_RUNNING and ADC_WAIT_FOR_RESULT

   

For my project I want to check if the timer is running, I can see from the documentation that the "readStatus" function returns the following parameters.. STATUS_DOWN and STATUS_RUNNING

   

   

I was thinking I could use them like so... if(Timer_ReadStatus() == STATUS_RUNNING) but PSoC creator is not happy with that..

   

any ideas?

0 Likes
2 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think it needs to be

   
if (Timer_ReadStatus()==Timer_STATUS_RUNNING)
   

but I did not test it... Otherwise: what is the error message you get from the compiler?

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

HLI is right, I tested it.

   

As a hint: Open the Timer.h file (if your component is named "Timer") and have a look (search) at STATUS_RUNNING.

   

As an agreement in C-language only, all names spelled in capital letters are #defined constants.

   

 

   

Bob

0 Likes