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

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

Re: [avr-gcc-list] Differences between avr-gcc 3.02 and 3.2


From: Robert_Beatty
Subject: Re: [avr-gcc-list] Differences between avr-gcc 3.02 and 3.2
Date: Fri, 20 Sep 2002 13:28:21 -0400

Hi Alex!

With my version of avrgcc (3.2), and a couple of tweaks, I can compile your
code.

The most important thing is to read the file ...\avr\include\sfr_defs.h,
which gives you some insight into the reason for the tweaks I've made.

First, looking at the file ...\avr\include\timer.h, there appears to be a
problem with the version that I received with my avrfreaks distribuition.
The original source for timer.h is:

    static inline void timer0_source (unsigned int src)
    {
      outb (src, TCCR0);
    }

    static inline void timer0_stop (void)
    {
      outb (0, TCNT0);
    }

    static inline void timer0_start (void)
    {
      outb (0x1, TCNT0);
    }

So the original is using the outb macro in the form outb(val,sfr).  But,
when you read the sfr_defs.h file, it says that outb should be
outb(sfr,val).  The older form of the macro was outp(val,sfr).  Not knowing
the history, I would guess that the timer.h file originally used outp, and
was quickly changed to outb without reversing the parameter order.  I
changed mine back to outp, since that macro is still defined in the
sfr_defs.h file (but may not be in future releases).  You may want to take
the more correct route and swap the parameters.

Hope this helps!

Regards,

Bob




Robert M. Beatty
Director Systems Engineering
The Watt Stopper Inc.
P: 401.562.4108
F: 401.562.4150
E: address@hidden

avr-gcc-list at http://avr1.org



reply via email to

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