avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] About context saving in Vectors


From: Preston Wilson
Subject: Re: [avr-gcc-list] About context saving in Vectors
Date: Wed, 14 Jan 2009 15:52:34 -0500
User-agent: Microsoft-Entourage/11.4.0.080122

>>>   The solution is to NOT call functions from within your ISR.  That is
>>> just evil.  Get your data in the ISR, put it in a mailbox or buffer
>>> and have a regularly scheduled function handle the details from
>>> outside the ISR.  I like to use ring buffers to store data from an
>>> ISR.  When using the ring buffer the ISR modifies the "write" pointer,
>>> not the read pointer and the processing function outside the ISR
>>> modifies the read pointer and not the write pointer.  This means that
>>> those pointers don't need "push/popped" in the ISR either.

I fully agree on the not calling functions within an ISR, keeping ISR code
as small as possible, and deferring as much processing to outside the ISR.
Plus all of the info on exclusive access techniques and read/write
pointers/indexes is also good.

But the original poster is using a version of gcc that had more than one bad
code generation issue if not properly patched, so even if he were to remove
the function call(s) from within the ISR(s), it is still possible that the
compiler is generating bad code.  He really needs to upgrade or patch the
compiler that is being used under Ubuntu.

-Preston






reply via email to

[Prev in Thread] Current Thread [Next in Thread]