Including cyapicallbacks.h in the project

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

cross mob
Anonymous
Not applicable

Hello,

   

I want to define a macro callback in a UART component by following the guide provided by Cypress. In the guide, it says that I have to define a macro in the file called "cyapicallbacks.h". However, the compiler isn't recognizing the defined the macro despite me putting the code in there. Then I realized that the project doesn't have #include "cyapicallbacks.h" written in any file anywhere. Is there a setting in the project that makes it so that somewhere in the generated code the cyapicallbacks.h file is included?

   

Thanks,

   

Alex

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

I didn't find such a place. I suggest you to create a support case, so that Cypress gets informed  and can fix it.

   

 

   

Bob

View solution in original post

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

I didn't find such a place. I suggest you to create a support case, so that Cypress gets informed  and can fix it.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Alex, did you ever figure this out? 

0 Likes
Anonymous
Not applicable

This solution worked for me (using PSoC Creator 3.3)

   

Create a cyapicallbacks.h file, add it to your project under "Header Files" section. Below is the contents of a default one (can't attach a .h file).

   

   

Delete your generated source folder (good idea to back it up first in case something goes wrong) and rebuild the project
. If you have a look at one of the generated source .c files, it should have an extra line:

   

   

 

   

cyapicallbacks.h:

   
    

/* ========================================
 *
 * Copyright YOUR COMPANY, THE YEAR
 * All Rights Reserved
 * UNPUBLISHED, LICENSED SOFTWARE.
 *
 * CONFIDENTIAL AND PROPRIETARY INFORMATION
 * WHICH IS THE PROPERTY OF your company.
 *
 * ========================================
*/
#ifndef CYAPICALLBACKS_H
#define CYAPICALLBACKS_H
    
    /*Define your macro callbacks here */
    /*For more information, refer to the Macro Callbacks topic in the PSoC Creator Help.*/
    
#endif /* CYAPICALLBACKS_H */   
/* [] */

   
   

 

   

I hope this helps.

   

 

   

   

0 Likes
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

Note: 
cyapicallbacks.h must be present in the .cydsn directory per http://www.cypress.com/forum/psoc-4-architecture/cmostartc-no-return-exception-handler-callback?sour...

   

THEN, delete generated files and rebuild.