Magelan1979
13.06.2010, 20:43
Wie gesagt bekome ich beim compilieren einen Fehler den ich mir nicht erklären kann. Die Attribute der eingebundenen #include "RP6ControlServoLib.h" verwendet er anstandslos. Nur die beiden Methoden mag er gar nicht akzeptieren
M32-File (Erweiterte RP6Control_08_I2CMaster)
#include "RP6ControlServoLib.h"
#include "RP6ControlLib.h" // The RP6 Control Library.
#include "RP6I2CmasterTWI.h" // I2C Master Library
#include "RP6M32Platinenmodul.h"
/************************************************** ***************************/
/************************************************** ***************************/
// Include our new "RP6 Control I2C Master library":
#include "RP6Control_I2CMasterLib.h"
...
...
/************************************************** ***************************/
// Main function - The program starts here:
int main(void)
{
initRP6Control();
initLCD();
writeString_P("\n\nRP6 CONTROL M32 I2C Master Example Program!\n");
writeString_P("\nInterrupts - part 2...\n");
// ---------------------------------------
// The Event Handlers can be set the same way as with the
// RP6Lib:
ACS_setStateChangedHandler(acsStateChanged);
BUMPERS_setStateChangedHandler(bumpersStateChanged );
IRCOMM_setRC5DataReadyHandler(receiveRC5Data);
// New LowBat Event Handler:
BATTERY_setLowVoltageHandler(batteryVoltageLow);
// New Watchdog Request Event Handler:
WDT_setRequestHandler(watchDogRequest);
// ---------------------------------------
// Init TWI Interface:
I2CTWI_initMaster(100);
I2CTWI_setRequestedDataReadyHandler(I2C_requestedD ataReady);
I2CTWI_setTransmissionErrorHandler(I2C_transmissio nError);
sound(180,80,25);
sound(220,80,25);
setLEDs(0b1111);
showScreenLCD("################", "################");
mSleep(500);
showScreenLCD("I2C-Master", "Example Program 3");
mSleep(1000);
setLEDs(0b0000);
// ---------------------------------------
// Setup ACS power:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_ACS_POWER, ACS_PWR_MED);
// Enable Watchdog for Interrupt requests:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_WDT, true);
// Enable timed watchdog requests:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_WDT_RQ, true);
showScreenLCD("ACS Status:", "");
startStopwatch3();
startStopwatch2();
initSERVO(SERVO2|SERVO4);
servo2_position = 95;
servo4_position = 90;
uint8_t cmd = DISTANZMESSEN;
while(true)
{
task_LCDHeartbeat();
task_checkINT0();
task_I2CTWI();
if(getPressedKeyNumber() == 4) cmd = FAHRTRICHTUNG;
cmd = behavior(cmd);
}
return 0;
}
Und das ist die Fehlermeldung
> "C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung\\make_all.bat"
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung>set LANG=C
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung>make all
-------- begin --------
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.
Size before:
AVR Memory Usage
----------------
Device: atmega32
Program: 8560 bytes (26.1% Full)
(.text + .data + .bootloader)
Data: 277 bytes (13.5% Full)
(.data + .bss + .noinit)
Compiling: RP6Control_08_I2CMaster.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Control_08_I2CMaster.lst -I../../RP6Lib -I../../RP6Lib/RP6control -I../../RP6Lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Control_08_I2CMaster.o.d RP6Control_08_I2CMaster.c -o RP6Control_08_I2CMaster.o
Linking: RP6Control_08_I2CMaster.elf
avr-gcc -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Control_08_I2CMaster.o -I../../RP6Lib -I../../RP6Lib/RP6control -I../../RP6Lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Control_08_I2CMaster.elf.d RP6Control_08_I2CMaster.o ../../RP6Lib/RP6control/RP6ControlLib.o ../../RP6Lib/RP6common/RP6uart.o RP6Control_I2CMasterLib.o ../../RP6Lib/RP6common/RP6I2CmasterTWI.o --output RP6Control_08_I2CMaster.elf -Wl,-Map=RP6Control_08_I2CMaster.map,--cref -lm
RP6Control_08_I2CMaster.o: In function `main':
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung/RP6Control_08_I2CMaster.c:331: undefined reference to `initSERVO'
make: *** [RP6Control_08_I2CMaster.elf] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
Ich hoffe es schauen nicht alle die WM im Fernsehen (P.S. das ZDF streamt)
Gruß und schönen Abend noch.
M32-File (Erweiterte RP6Control_08_I2CMaster)
#include "RP6ControlServoLib.h"
#include "RP6ControlLib.h" // The RP6 Control Library.
#include "RP6I2CmasterTWI.h" // I2C Master Library
#include "RP6M32Platinenmodul.h"
/************************************************** ***************************/
/************************************************** ***************************/
// Include our new "RP6 Control I2C Master library":
#include "RP6Control_I2CMasterLib.h"
...
...
/************************************************** ***************************/
// Main function - The program starts here:
int main(void)
{
initRP6Control();
initLCD();
writeString_P("\n\nRP6 CONTROL M32 I2C Master Example Program!\n");
writeString_P("\nInterrupts - part 2...\n");
// ---------------------------------------
// The Event Handlers can be set the same way as with the
// RP6Lib:
ACS_setStateChangedHandler(acsStateChanged);
BUMPERS_setStateChangedHandler(bumpersStateChanged );
IRCOMM_setRC5DataReadyHandler(receiveRC5Data);
// New LowBat Event Handler:
BATTERY_setLowVoltageHandler(batteryVoltageLow);
// New Watchdog Request Event Handler:
WDT_setRequestHandler(watchDogRequest);
// ---------------------------------------
// Init TWI Interface:
I2CTWI_initMaster(100);
I2CTWI_setRequestedDataReadyHandler(I2C_requestedD ataReady);
I2CTWI_setTransmissionErrorHandler(I2C_transmissio nError);
sound(180,80,25);
sound(220,80,25);
setLEDs(0b1111);
showScreenLCD("################", "################");
mSleep(500);
showScreenLCD("I2C-Master", "Example Program 3");
mSleep(1000);
setLEDs(0b0000);
// ---------------------------------------
// Setup ACS power:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_ACS_POWER, ACS_PWR_MED);
// Enable Watchdog for Interrupt requests:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_WDT, true);
// Enable timed watchdog requests:
I2CTWI_transmit3Bytes(I2C_RP6_BASE_ADR, 0, CMD_SET_WDT_RQ, true);
showScreenLCD("ACS Status:", "");
startStopwatch3();
startStopwatch2();
initSERVO(SERVO2|SERVO4);
servo2_position = 95;
servo4_position = 90;
uint8_t cmd = DISTANZMESSEN;
while(true)
{
task_LCDHeartbeat();
task_checkINT0();
task_I2CTWI();
if(getPressedKeyNumber() == 4) cmd = FAHRTRICHTUNG;
cmd = behavior(cmd);
}
return 0;
}
Und das ist die Fehlermeldung
> "C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung\\make_all.bat"
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung>set LANG=C
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung>make all
-------- begin --------
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.
Size before:
AVR Memory Usage
----------------
Device: atmega32
Program: 8560 bytes (26.1% Full)
(.text + .data + .bootloader)
Data: 277 bytes (13.5% Full)
(.data + .bss + .noinit)
Compiling: RP6Control_08_I2CMaster.c
avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Control_08_I2CMaster.lst -I../../RP6Lib -I../../RP6Lib/RP6control -I../../RP6Lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Control_08_I2CMaster.o.d RP6Control_08_I2CMaster.c -o RP6Control_08_I2CMaster.o
Linking: RP6Control_08_I2CMaster.elf
avr-gcc -mmcu=atmega32 -I. -gdwarf-2 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=RP6Control_08_I2CMaster.o -I../../RP6Lib -I../../RP6Lib/RP6control -I../../RP6Lib/RP6common -std=gnu99 -MD -MP -MF .dep/RP6Control_08_I2CMaster.elf.d RP6Control_08_I2CMaster.o ../../RP6Lib/RP6control/RP6ControlLib.o ../../RP6Lib/RP6common/RP6uart.o RP6Control_I2CMasterLib.o ../../RP6Lib/RP6common/RP6I2CmasterTWI.o --output RP6Control_08_I2CMaster.elf -Wl,-Map=RP6Control_08_I2CMaster.map,--cref -lm
RP6Control_08_I2CMaster.o: In function `main':
C:\Users\MagelansPC\Desktop\RP6\Projekt 1\Projekt\M32-Modulsteuerung/RP6Control_08_I2CMaster.c:331: undefined reference to `initSERVO'
make: *** [RP6Control_08_I2CMaster.elf] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
Ich hoffe es schauen nicht alle die WM im Fernsehen (P.S. das ZDF streamt)
Gruß und schönen Abend noch.