Including Header files

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

cross mob
adpac_1560036
Level 4
Level 4
First like received First like given

Hi,

   

Each time when I build a project, the header files I've included into interrupt service routine files are getting deleted.

   

Its becoming a recurring task to again type the #include directive at all the isr.c files for the every time I build.

   

Same problem is encounterd when the design is modified even without touching the isr component.

   

Solution for this?

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

There are special areas within the generated files that allow for code insertion by you. These areas are clearly marked.

   

Generally I would suggest to avoid making changes in those files. There are two different ways to circumvent this:

   

Use _StartEx() APIs of the component to announce your own interrupt handlers, might be in main(). Use CY_ISR and CY_ISR_PROTO as documented in System Reference Guide (from Help-menu of Creator)

   

Latest Creator version introduces "Callback Macros". A file named cyapicallbacks.h is generated with a new project. Here you specify from which API you want to have a callback and you provide a function with a given name to be called back. See Creator Help for "Callback macros)

   

 

   

Bob

View solution in original post

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

There are special areas within the generated files that allow for code insertion by you. These areas are clearly marked.

   

Generally I would suggest to avoid making changes in those files. There are two different ways to circumvent this:

   

Use _StartEx() APIs of the component to announce your own interrupt handlers, might be in main(). Use CY_ISR and CY_ISR_PROTO as documented in System Reference Guide (from Help-menu of Creator)

   

Latest Creator version introduces "Callback Macros". A file named cyapicallbacks.h is generated with a new project. Here you specify from which API you want to have a callback and you provide a function with a given name to be called back. See Creator Help for "Callback macros)

   

 

   

Bob

0 Likes

Oh yes..got it. Thanks a lot Bob.

   

Aditya

0 Likes