SAM E70 Interrupts not working when ISR is movet to (.h) file

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Am working on SAM E70 Xplained Development Borad, and I have enables external interrupt on the push button switch with ISR in "main.c" file and the program is working good.

Now when i moved the External interrupt handler to a ".h" header file, the program compiles without any error, but interrupts are not getting triggered.

Any idea like the interrupts are not getting triggered?

 

This topic has a solution.

Silly beans are always silly
:)

Last Edited: Wed. Jul 19, 2017 - 12:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Why would you use a pushbutton on an interrupt and why would you put code in a .h file?

I think you'll have to show us the code so we can see what you are doing.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Kartman,

I used push button because it is easy for me to test its working using SAME70 Xplained development board.

I tried moving most of the function to header files because I wanted the main.c to look as simple as possible.

The program is in my working machine & i might need some time to export it from that PC to this one that has got internet.

cheeky

Silly beans are always silly
:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Move your code to other .c file. Never put code in .h files.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Definitions are written in .c file. Only the declaration in present in .h file.

Silly beans are always silly
:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

no need to defineinterrupt functions. They are already defined by ASF

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I could see default ISRs for timers, usarts, etc.

But for ext. int. we need to define the ISR

Silly beans are always silly
:)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe its something that I doesn't know.
Am not an expert in ASF & atmel Studio

Silly beans are always silly
:)

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got the issue resolved,

since I have moved the ISR to header files, it seems like the control jumps straight to the default ISR defined by ASF rather than navigating to the ISR defined in the header files.

This issues was resolved by associating the location of these ISR to main & with that minor modification, everything seems to be working in good order.

smiley

Silly beans are always silly
:)