cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

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
Reply
1 Solution
JoMe_264151
Expert II

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
Reply
4 Replies
JoMe_264151
Expert II

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
Reply
Anonymous
Not applicable

Alex, did you ever figure this out? 

0 Likes
Reply
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
Reply
MiMi_1891471
Contributor

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.