[Top][All Lists]

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

Re: [avr-gcc-list] efficient Timer Interrupts

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] efficient Timer Interrupts
Date: Wed, 22 Oct 2003 17:37:10 +0200 (MET DST)

As Torsten Hahn <address@hidden> wrote:

>The problem for me is, that using an extern (ram) var as a counter
>consumes much processor cycles (loading the var from ram,
>decrementing, write back). Is there a better (faster) solution ?

If you can sacrifice a register for it globally, you can use

register foobar asm("r2");

This might lead to a pessimisation in the remaining code.  Also, if
your code consists of multiple source modules, you need to tell this
in each of them so the compiler won't accidentally reassign this
register for something else.

Note that registers 0 and 1 are required for internal gcc use.

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

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