muetzeglatze
09.03.2014, 16:19
Wäre nett wenn mir jmd erklären könnte weshalb es "warten_5sec ()" nicht erkennt!
#include "asuro.h" // Compileranweisung (#)
int main(void) // Hauptfunktion
{
Init(); // ASURO in den Grundzustand setzen
unsigned int i; // Variable i Declaieren
warten_5sec()
{ for (i=0; i<5000; i++) // er wartet 5 sek
{Sleep(72);} // 1 ms
}
StatusLED (OFF); // alle LED's aus
StatusLED(GREEN); // Hier wird die Status LED auf grün eingeschaltet
BackLED(ON,OFF);
warten_5sec
StatusLED(OFF); // Status LED aus
BackLED(ON,ON); // BackLED's an
warten_5sec
while (1);
{
for (i=0; i<282; i++) // wartet 1 ms
{Sleep(255);} // wartet 1 sek
StatusLED (RED);
for (i=0; i<282; i++)
{Sleep(255);}
StatusLED (YELLOW);
for (i=0; i<282; i++)
{Sleep(255);}
StatusLED (OFF);
}
FrontLED(ON); // und hier die vordere LED einschalten
while(1); // Endlosschleife
return 0; // Rückgabewert der Hauptfunktion
}
Fehlermeldung:
> "C:\ASURO_src\FirstTry\Test-all.bat"
C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function 'main':
test.c:24: warning: implicit declaration of function 'warten_5sec'
test.c:25: error: expected ';' before '{' token
test.c:37: warning: statement with no effect
test.c:37: error: expected ';' before 'StatusLED'
test.c:40: warning: statement with no effect
test.c:40: error: expected ';' before 'while'
make: *** [test.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
27744
#include "asuro.h" // Compileranweisung (#)
int main(void) // Hauptfunktion
{
Init(); // ASURO in den Grundzustand setzen
unsigned int i; // Variable i Declaieren
warten_5sec()
{ for (i=0; i<5000; i++) // er wartet 5 sek
{Sleep(72);} // 1 ms
}
StatusLED (OFF); // alle LED's aus
StatusLED(GREEN); // Hier wird die Status LED auf grün eingeschaltet
BackLED(ON,OFF);
warten_5sec
StatusLED(OFF); // Status LED aus
BackLED(ON,ON); // BackLED's an
warten_5sec
while (1);
{
for (i=0; i<282; i++) // wartet 1 ms
{Sleep(255);} // wartet 1 sek
StatusLED (RED);
for (i=0; i<282; i++)
{Sleep(255);}
StatusLED (YELLOW);
for (i=0; i<282; i++)
{Sleep(255);}
StatusLED (OFF);
}
FrontLED(ON); // und hier die vordere LED einschalten
while(1); // Endlosschleife
return 0; // Rückgabewert der Hauptfunktion
}
Fehlermeldung:
> "C:\ASURO_src\FirstTry\Test-all.bat"
C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function 'main':
test.c:24: warning: implicit declaration of function 'warten_5sec'
test.c:25: error: expected ';' before '{' token
test.c:37: warning: statement with no effect
test.c:37: error: expected ';' before 'StatusLED'
test.c:40: warning: statement with no effect
test.c:40: error: expected ';' before 'while'
make: *** [test.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
27744