EEMEM bei GCC 20070525

Gast #835761
Lesenswert?

Hallo und gleich mal Hilfe!!!

Beim umschreiben des Sourccode von einer alten auf die neue GCC-Version 
hab ich folgendes Problem:

Im main.c hab ich den Speicherplatz im EEPROM vereinbart

u08  ee_osccal   EEMEM    = 0x00;

Um nun die Variable ee_osccal auch in einer andere Source nutzen zu 
können, hab ich im zugeordneten rtr3.h-File folgende externe 
Vereinbarung reingeschrieben

extern  u08  ee_osccal  EEMEM  = 0x00;

Bei compilieren kommen dann folgende Fehler:

Compiling: main.c
avr-gcc -c -mmcu=atmega128 -I. -g -O0 -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall 
-Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 main.c -o main.o
In file included from main.c:31:
rtr3.h:15: error: parse error before "ee_osccal"
rtr3.h:15: warning: type defaults to `int' in declaration of `EEMEM'
rtr3.h:15: warning: data definition has no type or storage class
main.c:45: error: parse error before "EEMEM"
main.c:45: warning: type defaults to `int' in declaration of `EEMEM'
main.c:45: warning: data definition has no type or storage class
make: *** [main.o] Error 1

Was mach ich hier falsch? Hab auch schon andere Foren durchsucht, aber 
keine Antwort bekommen.

Bitte um Hilfe - Danke
Peter
Gast #835782
Lesenswert?

ja - hier der Anfang von main.c


#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>

#include  "rtr3.h"
#include  "global.h"
#include  "i2c.h"
#include  "ds1307.h"
#include  "lcd.h"
#include  "rprintf.h"
#include  "modbus.h"
#include  "timer128.h"
Gast #835812
Lesenswert?

Hallo Johannes
1
#include <avr/io.h>
2
#include <avr/interrupt.h>
3
#include <avr/pgmspace.h>
4
#include <avr/eeprom.h>
5
#include <stdio.h>
6
#include <stdlib.h>
7
#include <string.h>
8
#include <inttypes.h>
9

10
#include  "global.h"
11
#include  "rtr3.h"
12
#include  "i2c.h"
13
#include  "ds1307.h"
14
#include  "lcd.h"
15
#include  "rprintf.h"
16
#include  "modbus.h"
17
#include  "timer128.h"
18

19
//-----------------------------------------------------------------------
20
// EEPROM
21
//-----------------------------------------------------------------------
22

23
u08    ee_osccal     EEMEM    = 0x00;      // Oszillator
In der zwischenzeit hab ich "global.h" vor "rtr3.h" gesetzt, da dort die 
defs für die Datentypen hinterlegt sind.
Vor Zeile 45 gibt es nur wie oben zu sehen die Include-Files.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren