To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2372
2371  |  2373
Subject: 
Re: [long] Interrupt programming, buggy code
Newsgroups: 
lugnet.robotics.rcx
Date: 
Tue, 2 Mar 2004 18:57:30 GMT
Viewed: 
3409 times
  
In lugnet.robotics.rcx, Mark Riley wrote:

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.  It won't cause a problem in your current code because the ROM
dispatch code already preserves r6 for your ISR.

Eh...  Never mind this bit.  I just had a gander at Kekoa's rcxlib and he
already handles this correctly in debug_value().  Should've known!  :-)

Mark



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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR