irobot_22587
01.01.2007, 00:36
!!!!!!Hilfe!!!!!!!
Die erweiterten Lib Funktionen sehen sehr gut aus. Wuerde ich gerne nutzen.
Ich bekomme jedoch immer eine Compiler Fehlermeldung, wenn ich die asuro.c und asuro.h durch die Dateien der neuen version ersetze. Unten in der Code Section die Fehlermeldung und die Auszuegen aus dem makefile, meinem Programm und der asuro.c (ver2.61) Dateien.
Bitte dringends um Hilfe, komme mit meinen Projekten nicht weiter.
Gruesse und frohes neues Jahr aus dem sonnigen Kalifornien!
************************************************** *************************************
******************************Fehlermeldung aus PN2************************************
************************************************** *************************************
C:\azuro\ASURO_src\Edge>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=Edge.lst Edge.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > Edge.d; \
[ -s Edge.d ] || rm -f Edge.d
make: *** Warning: File `Edge.d' has modification time in the future (2007-01-01 00:06:36 > 2007-01-01 00:06:34)
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 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=Edge.lst Edge.c -o Edge.o
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=C:/azuro/ASURO_src/Edge/asuro.lst C:/azuro/ASURO_src/Edge/asuro.c -o C:/azuro/ASURO_src/Edge/asuro.o
C:/azuro/ASURO_src/Edge/asuro.c:184: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:184: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c: In function `SIGNAL':
C:/azuro/ASURO_src/Edge/asuro.c:188: warning: control reaches end of non-void function
C:/azuro/ASURO_src/Edge/asuro.c: At top level:
C:/azuro/ASURO_src/Edge/asuro.c:195: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:195: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c:195: error: redefinition of `SIGNAL'
C:/azuro/ASURO_src/Edge/asuro.c:184: error: `SIGNAL' previously defined here
C:/azuro/ASURO_src/Edge/asuro.c:212: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:212: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c:212: error: redefinition of `SIGNAL'
C:/azuro/ASURO_src/Edge/asuro.c:195: error: `SIGNAL' previously defined here
make: *** [C:/azuro/ASURO_src/Edge/asuro.o] Error 1
> Process Exit Code: 2
************************************************** *************************************
************************************MAKEFILE AUSZUG **********************************
************************************************** *************************************
# Target file name (without extension).
TARGET = Edge
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c
# If there is more than one source file, append them above, or adjust and
# uncomment the following:
SRC += C:/azuro/ASURO_src/Edge/asuro.c
# You can also wrap lines by appending a backslash to the end of the line:
#SRC += baz.c \
#xyzzy.c
************************************************** *************************************
************************************Programm AUSZUG **********************************
************************************************** *************************************
#include "c:/azuro/ASURO_src/Edge/asuro.h"
#include "stdlib.h"
#include "string.h"
int main(void)
{
int data[2], array[5], i, j, speed, avg, pointer;
Init();
StatusLED(GREEN);
FrontLED(ON);
BackLED(OFF,OFF);
avg=0;
pointer=0;
speed=120;
for (i=0;i<20;i++) LineData(data); // make sure sensors are OK
// SerWrite("\n\r-- ASURO Calibration --\n\r",27);
for (i=0;i<5;i++){
************************************************** *************************************
********************* asuro.c Ver2.61 AUSZUG Line 178-217 *****************************
************************************************** *************************************
/*!
* \func SIG_OVERFLOW2
* \brief Interrupt Funktion: Timer2 Overflow
* uses timer2 (36kHz for IR communication)
*/
SIGNAL (SIG_OVERFLOW2)
{
TCNT2 += 0x25;
count36kHz ++;
if (!count36kHz) timebase ++;
}
/*!
* \func SIG_INTERRUPT1
* \brief Interrupt Funktion: INT1
*/
SIGNAL (SIG_INTERRUPT1)
{
switched=1;
StopSwitch();
}
/*!
* \func SIG_ADC
* \brief Interrupt Funktion: A/D Wandler
* last modification:
* Ver. Date Author Comments
* ------- ---------- -------------- ---------------------------------
* 2.61 20.11.2006 m.a.r.v.i.n static Variable toggle initialisiert
* auf False (Bug report von Rolf_Ebert)
*
*
*/
SIGNAL (SIG_ADC)
{
static unsigned char tmp[2],flag[2],toggle=FALSE;
if (autoencode){
tmp[toggle]= ADCH;
if (toggle) ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_RIGHT;
else ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_LEFT;
Die erweiterten Lib Funktionen sehen sehr gut aus. Wuerde ich gerne nutzen.
Ich bekomme jedoch immer eine Compiler Fehlermeldung, wenn ich die asuro.c und asuro.h durch die Dateien der neuen version ersetze. Unten in der Code Section die Fehlermeldung und die Auszuegen aus dem makefile, meinem Programm und der asuro.c (ver2.61) Dateien.
Bitte dringends um Hilfe, komme mit meinen Projekten nicht weiter.
Gruesse und frohes neues Jahr aus dem sonnigen Kalifornien!
************************************************** *************************************
******************************Fehlermeldung aus PN2************************************
************************************************** *************************************
C:\azuro\ASURO_src\Edge>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=Edge.lst Edge.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > Edge.d; \
[ -s Edge.d ] || rm -f Edge.d
make: *** Warning: File `Edge.d' has modification time in the future (2007-01-01 00:06:36 > 2007-01-01 00:06:34)
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 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=Edge.lst Edge.c -o Edge.o
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=C:/azuro/ASURO_src/Edge/asuro.lst C:/azuro/ASURO_src/Edge/asuro.c -o C:/azuro/ASURO_src/Edge/asuro.o
C:/azuro/ASURO_src/Edge/asuro.c:184: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:184: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c: In function `SIGNAL':
C:/azuro/ASURO_src/Edge/asuro.c:188: warning: control reaches end of non-void function
C:/azuro/ASURO_src/Edge/asuro.c: At top level:
C:/azuro/ASURO_src/Edge/asuro.c:195: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:195: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c:195: error: redefinition of `SIGNAL'
C:/azuro/ASURO_src/Edge/asuro.c:184: error: `SIGNAL' previously defined here
C:/azuro/ASURO_src/Edge/asuro.c:212: warning: return type defaults to `int'
C:/azuro/ASURO_src/Edge/asuro.c:212: warning: function declaration isn't a prototype
C:/azuro/ASURO_src/Edge/asuro.c:212: error: redefinition of `SIGNAL'
C:/azuro/ASURO_src/Edge/asuro.c:195: error: `SIGNAL' previously defined here
make: *** [C:/azuro/ASURO_src/Edge/asuro.o] Error 1
> Process Exit Code: 2
************************************************** *************************************
************************************MAKEFILE AUSZUG **********************************
************************************************** *************************************
# Target file name (without extension).
TARGET = Edge
# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c
# If there is more than one source file, append them above, or adjust and
# uncomment the following:
SRC += C:/azuro/ASURO_src/Edge/asuro.c
# You can also wrap lines by appending a backslash to the end of the line:
#SRC += baz.c \
#xyzzy.c
************************************************** *************************************
************************************Programm AUSZUG **********************************
************************************************** *************************************
#include "c:/azuro/ASURO_src/Edge/asuro.h"
#include "stdlib.h"
#include "string.h"
int main(void)
{
int data[2], array[5], i, j, speed, avg, pointer;
Init();
StatusLED(GREEN);
FrontLED(ON);
BackLED(OFF,OFF);
avg=0;
pointer=0;
speed=120;
for (i=0;i<20;i++) LineData(data); // make sure sensors are OK
// SerWrite("\n\r-- ASURO Calibration --\n\r",27);
for (i=0;i<5;i++){
************************************************** *************************************
********************* asuro.c Ver2.61 AUSZUG Line 178-217 *****************************
************************************************** *************************************
/*!
* \func SIG_OVERFLOW2
* \brief Interrupt Funktion: Timer2 Overflow
* uses timer2 (36kHz for IR communication)
*/
SIGNAL (SIG_OVERFLOW2)
{
TCNT2 += 0x25;
count36kHz ++;
if (!count36kHz) timebase ++;
}
/*!
* \func SIG_INTERRUPT1
* \brief Interrupt Funktion: INT1
*/
SIGNAL (SIG_INTERRUPT1)
{
switched=1;
StopSwitch();
}
/*!
* \func SIG_ADC
* \brief Interrupt Funktion: A/D Wandler
* last modification:
* Ver. Date Author Comments
* ------- ---------- -------------- ---------------------------------
* 2.61 20.11.2006 m.a.r.v.i.n static Variable toggle initialisiert
* auf False (Bug report von Rolf_Ebert)
*
*
*/
SIGNAL (SIG_ADC)
{
static unsigned char tmp[2],flag[2],toggle=FALSE;
if (autoencode){
tmp[toggle]= ADCH;
if (toggle) ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_RIGHT;
else ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_LEFT;