changing a deafault function related to a library component

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

hi,

   

I've been trying to turn a project of AN61102 called "ADC_DMA_16bit_Continuous" into a library component

   

the only problem I have had is that in this project there is a change in a default function of DMA - "DMA_Done_isr.c"

   

when I'm trying to add the new component into a new project, I have to manually update the code lines in the created function DMA_Done_isr.c (and every time something changes in the new project, and I recompile, the default definition of the function is rebuilt)

   

I've tried using the following code lines in the component C file :

   

                      CY_ISR_PROTO(`$INSTANCE_NAME`_DMA_Done_isr_Interrupt);

   

                                                  ....... // the main function enters here ..........

   

                      CY_ISR(Scope_1_DMA_Done_isr_Interrupt)
                     {         
                             Scope_1_DMA_done=1;
                     }

   

this seem to work only if I delete the CY_ISR function from the file "DMA_Done_isr.c" , and every time I recompile the project I have to delete it again (If I don't delete it, an error message appears saying "Build error: multiple definition of `Scope_1_DMA_Done_isr_Interrupt'"

   

How can I make the change in the library component permanent without the need to delete or update the code lines every time

   

 

   

I have added the library component I've created and an example project, just so that you can see what I'm talking about

   

 

   

I would appreciate getting help

   

thanks 

   

Yossef

0 Likes
2 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Do not use built-in interrupt. Instead, attach external ISR component, write some code to execute on interrupt, and enable ISR using StartEx(...) function. odissey1 See AN54460-psoc-3-and-psoc-5lp-interrupt http://www.cypress.com/documentation/application-notes/an54460-psoc-3-and-psoc-5lp-interrupts?source...   
0 Likes
Anonymous
Not applicable

Odissey1 thank you very much,

   

I used isr_StartEx(myIsr) and it worked like a magic.

0 Likes