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: Dave Hylands
Subject: Re: [avr-gcc-list] About context saving in Vectors
Date: Wed, 14 Jan 2009 17:27:37 -0800

Hi Daniel,

>> And here's some code that implements such a ring buffer. As David
>> Kelly points out, as long as the index type is uint8_t, then nothing
>> special is required (which for this particular implementation means
>> that buffers upto 128 entries would be supported)
>>
>> <http://websvn.hylands.org/filedetails.php?repname=Projects&path=%2Fcommon%
>>2FCBUF.h&rev=0&sc=0>
>>
>> It's important that the queue be declared volatile (as myQ is in the
>> sample).
>
> And I was just about to ask if someone could post some well tested code! :)

Yes - I use this for all of my UART stuff.

You can find interrupt based UART code which uses CBUF over here:
<http://websvn.hylands.org/filedetails.php?repname=Projects&path=%2Fcommon%2Favr%2FUART.h&rev=0&sc=0>
<http://websvn.hylands.org/filedetails.php?repname=Projects&path=%2Fcommon%2Favr%2FUART.c&rev=0&sc=0>

A typical Config.h (which can be different for each project) looks like this:
<http://websvn.hylands.org/filedetails.php?repname=Projects&path=%2Favr%2FFlash-LED-robostix%2FConfig.h&rev=0&sc=0>

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/




reply via email to

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