Subject:
|
Re: [long] Interrupt programming, buggy code
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Tue, 2 Mar 2004 23:15:12 GMT
|
Viewed:
|
3668 times
|
| |
| |
On Tue, 2 Mar 2004 17:54:47 GMT
"Mark Riley" <markril@hotmail.com> wrote:
Hi Mark,
> When you declare your ISR as an interrupt_handler, GCC terminates the
> function with an "rte" instead of an "rts". The ROM code that
> dispatches the interrupt to your function is already doing the rte so
> your function should not.
[snip]
> Instead, you could remove the interrupt_handler attribute and preserve
> the scratch registers like so:
[snip]
And that was it, indeed! Many to you, as well as Ralph and Kevin who
tried to help me. There shouldn't be much trouble for me I think (if we
forgot that I already pronounced this sentence sevral times before).
> Also, the C compiler that generated the ROM code uses a different
> calling convention than GCC and r6 is trashed by the debug_value()
> call. GCC isn't expecting this, so it may be prudent to wrap calls to
> debug_value() with a push and pop of r6.
I already knew this one and didn't have trouble withit since the code is
not mine but Kekoa's :-) As you mention in another follow-up, Kekoa's
code is neat and clean and does the *right* things.
> HTH,
It did. Really.
--
Benjamin
|
|
Message is in Reply To:
| | Re: [long] Interrupt programming, buggy code
|
| Hi Benjamin, When you declare your ISR as an interrupt_handler, GCC terminates the function with an "rte" instead of an "rts". The ROM code that dispatches the interrupt to your function is already doing the rte so your function should not. Here's (...) (21 years ago, 2-Mar-04, to lugnet.robotics.rcx)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|