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

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

Re: [avr-gcc-list] probelms with new avr-gcc from avr-freaks


From: Marek Michalkiewicz
Subject: Re: [avr-gcc-list] probelms with new avr-gcc from avr-freaks
Date: Sat, 6 Jul 2002 20:55:19 +0200 (CEST)

> instead of including <io.h> i use "io2.h" which is the following:
> #include <io.h>
> #undef _SFR_IO8
> #define _SFR_IO8(x) (x)
> 
> and all is compilable for me. 
> Can i run in any trouble with that for me simplier solution?

Even simpler, put this at the top of your *.S source files:

#define __SFR_OFFSET 0
#include <io.h>

See <avr/sfr_defs.h> for comments how it all works...

By default __SFR_OFFSET is defined as 0x20 which means that all I/O
register names are defined as memory addresses - this is good for
ATmega128/162 as you can simply always use lds/sts.  For example, SPMCR
can be at I/O address 0x37 (memory address 0x57) or memory address 0x68
depending on device type.

Marek

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



reply via email to

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