Hallo,
ich habe ein Problem bei make all:
Wenn ich Msleep () benutze zeigt Programmers Notepad 2 mir folgende Meldung an:
> "make.exe" 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
In file included from asuro.h:34,
from test.c:1:
d:/asuro/programme/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
test.c: In function 'main':
test.c:12: warning: implicit declaration of function 'Msleep'
test.c:15: warning: control reaches end of non-void function
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
In file included from asuro.h:34,
from asuro.c:29:
d:/asuro/programme/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
test.o: In function `main':
D:\ASURO\Aufgaben\1m/test.c:12: undefined reference to `Msleep'
make.exe: *** [test.elf] Error 1
> Process Exit Code: 2
> Time Taken: 00:02
Dann habe ich mir eine neue asuro.h und asuro.c gedownloadet und dann kommt das:
> "make.exe" 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
asuro.c:68:21: error: myasuro.h: No such file or directory
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
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
asuro.c:68:21: error: myasuro.h: No such file or directory
-------- 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:15: warning: control reaches end of non-void function
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
asuro.c:68:21: error: myasuro.h: No such file or directory
asuro.c: In function 'IsrStandard':
asuro.c:173: error: 'MY_SWITCH_THRESHHOLD' undeclared (first use in this function)
asuro.c:173: error: (Each undeclared identifier is reported only once
asuro.c:173: error: for each function it appears in.)
asuro.c: In function 'Init':
asuro.c:260: error: 'F_CPU' undeclared (first use in this function)
make.exe: *** [asuro.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
Mein Programm sieht so aus:
#include "asuro.h"
#define cm 75
int main (void)
{
Init();
MotorDir (FWD,FWD);
//Strecke 1m;
MotorSpeed (125,125);
Msleep ( 100 * cm );
MotorSpeed (0,0);
}
Wenn ich Msleep ( 100 * cm); entferne funktioniert es.
Vielen Dank im Voraus
Lesezeichen