How to store all interrupts in one file and stop the auto creation of interrupt files

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

cross mob
SaWa_284216
Level 4
Level 4

I want to have a file called interrupts.c and I want to just have my interrupt in it without any of the other generated code which PSoC creator makes whenever you drop an interrupt pin on the schematic.

   

 

   

Is this possible?

   


Thanks

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

Sure. Use CY_ISR / CY_ISR_PROTO to define your interrupt function (in the .c / .h file). Having done that, start your component with *_StartEx(&function) to hand it your interrupt function.

0 Likes
SaWa_284216
Level 4
Level 4

 Okay so as I understand this,

   

create file called interrupts.c and do all the CY stuff etc, then in main start the interrupts off with startEx and then a link to the function in interrupts.c

   

What will happen with the autogeneration of files though, will they still get generated?

0 Likes
SaWa_284216
Level 4
Level 4

 Yeah after trying what you said and deleting the generated files it just keeps regenerating them on rebuild and then complaining about multiple definitions of the same interrupt

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

Usually the files will be generated, but under normal conditions (default settings) the linker will optimize-out the unneeded functions, so there will be no double code.

   

 

   

Bob

0 Likes
SaWa_284216
Level 4
Level 4

 I have got it working, all I did was give my own interrupts unique names, so the ones in the generated files exist but instead of default name blah_Interrupt I just used something original.. eg *_StartEx(lovelyLadyLumps);  

   


Thanks for the help guys!

0 Likes