Hallo Ihr, Vielleicht könnt ihr mir helfen...
ich habe ein Programm geschrieben welches mittels der externen Interrupts an PORTD alle Leds an PORTB aus bzw. einschalten soll.
Ich verwende dazu das STK500/STK501.
Und hier ist der Code:Beim Versuch dies alles zu kompilieren erhalte ich jedoch folgenden fehler:Code:#define __AVR_ATmega128__ #include <avr/io.h> #include <interrupt.h> int main() { cli(); DDRB = 0xff; PORTB = 0xff; DDRD = 0x00; MCUCR |= 0b00000101 GICR = 0xff; sei(); while(1); } SIGNAL(SIG_INTERRUPT0) { PORTB = 0x00; } SIGNAL(SIG_INTERRUPT1) { PORTB = 0xff; }
Ich habe keine Ahnung was das sein könnte, aber vielleicht könnt ihr mir weiterhelfen...Code:Compiling: test.c avr-gcc -c -mmcu=atmega128 -I. -gstabs -O3 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.lst -std=gnu99 -Wp,-M,-MP,-MT,test.o,-MF,.dep/test.o.d test.c -o test.o test.c:18: warning: function declaration isn't a prototype test.c:18: warning: return type of 'main' is not `int' test.c: In function `main': test.c:25: error: `GICR' undeclared (first use in this function) test.c:25: error: (Each undeclared identifier is reported only once test.c:25: error: for each function it appears in.) test.c: At top level: test.c:30: warning: return type defaults to `int' test.c:30: warning: function declaration isn't a prototype test.c: In function `SIGNAL': test.c:30: warning: type of "__vector_1" defaults to "int" test.c: At top level: test.c:35: warning: return type defaults to `int' test.c:35: warning: function declaration isn't a prototype test.c:35: error: redefinition of 'SIGNAL' test.c:30: error: previous definition of 'SIGNAL' was here test.c: In function `SIGNAL': test.c:35: warning: type of "__vector_2" defaults to "int" make.exe: *** [test.o] Error 1
mfg diesollbruchstelle







Zitieren

Lesezeichen