Arm Community
Site
Search
User
Site
Search
User
Support forums
Architectures and Processors forum
SAM7X calling function from interrupt
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
5 replies
Subscribers
349 subscribers
Views
5899 views
Users
0 members are here
Software
Arm7tdmi
Interrupt
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
SAM7X calling function from interrupt
fjb2069 fjb2069
over 12 years ago
Note: This was originally posted on 5th November 2008 at
http://forums.arm.com
I am trying to use a timer interrupt to "Set up" a function call. INstead of setting a flag in the interrupt and then polling that flag I would like the interrupt to call a function as soon as teh interrupt is done, but not during the interrupt.
I tried setting a software (swi) interrupt to fire during the timer interupt, but the problem was that it called the software int immediatley during the timer IRQ and not after. I thought the swi was a lower priotrity int then the timer IRQ (set to priority 7), But I guess not...am I wrong????
Is ther a way to do this?
Possibley use a lower priority IRQ to call a function by "Setting" that IRQ during a higher priority IRQ ?
Parents
0
Jacob Bramley
over 12 years ago
Note: This was originally posted on 6th November 2008 at
http://forums.arm.com
In this case, you simply want a list of function pointers. When you want to register a DFC, you add a function pointer to the list. When you run one, you remove it from the list.
Things to consider:
The list can be a simple array, but you'll need extra variables to indicate free slots and the like. If I were you, I'd use either a linked list or an array-based circular buffer. Google will have plenty of information on both.
If you aren't familiar with function pointers, try Google. There's tons of information on the web.
Your DFCs will probably need some data, so you may need another list of data to provide to the functions. This is entirely dependent on your application, however.
Good luck :-)
Cancel
Vote up
0
Vote down
Cancel
Reply
0
Jacob Bramley
over 12 years ago
Note: This was originally posted on 6th November 2008 at
http://forums.arm.com
In this case, you simply want a list of function pointers. When you want to register a DFC, you add a function pointer to the list. When you run one, you remove it from the list.
Things to consider:
The list can be a simple array, but you'll need extra variables to indicate free slots and the like. If I were you, I'd use either a linked list or an array-based circular buffer. Google will have plenty of information on both.
If you aren't familiar with function pointers, try Google. There's tons of information on the web.
Your DFCs will probably need some data, so you may need another list of data to provide to the functions. This is entirely dependent on your application, however.
Good luck :-)
Cancel
Vote up
0
Vote down
Cancel
Children
No data