also ich habe mal versucht, die makefiles zu vergleichen und die einstellungen zu verändern. nun sieht der file folgendermaßen aus:
Code:
###############################################################################
# Makefile for the project TestProjekt
###############################################################################
## General Flags
PROJECT = TestProjekt
MCU = atmega8
TARGET = program.elf
CC = avr-gcc.exe
## Options common to compile, link and assembly rules
COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
CFLAGS = $(COMMON)
CFLAGS += -Wall -gdwarf-2 -DF_CPU=8000000UL -Os -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += $(CFLAGS)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS += -Wl,-Map=program.map
## Intel Hex file production flags
HEX_FLASH_FLAGS = -R .eeprom
HEX_EEPROM_FLAGS = -j .eeprom
HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load"
HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 --no-change-warnings
## Include Directories
INCLUDES = -I"C:\Users\michael\Asuro\Workspace\eigener test\TestProjekt\..\..\..\Asuro lib\AsuroLib-v270rc3\lib\inc"
## Library Directories
LIBDIRS = -L"C:\WinAVR\avr\lib" -L"C:\Users\michael\Asuro\Asuro lib\AsuroLib-v270rc3\lib"
## Libraries
LIBS = -lasuro
## Objects that must be built in order to link
OBJECTS = TestProjekt.o 001.o asuro.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) program.hex program.eep program.lss size
## Compile
TestProjekt.o: ../TestProjekt.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
001.o: ../001.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
asuro.o: ../../../../Asuro lib/AsuroLib-v270rc3/lib/asuro.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
##Link
$(TARGET): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET)
%.hex: $(TARGET)
avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@
%.eep: $(TARGET)
-avr-objcopy $(HEX_EEPROM_FLAGS) -O ihex $< $@ || exit 0
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) program.elf dep/* program.hex program.eep program.lss program.map
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)
aber eine hex wird immer noch nicht erstellt. mein programm sieht nun so aus:
Code:
#include "asuro.h"
//void Sleep3ms(short b);
int main(void)
{
Init();
while(1){
if(PollSwitch()!=0) {
//SerPrint("Achtung\n");
if(PollSwitch()>7){//links
SetMotorPower (0,0);
// Sleep3MS(50);
SetMotorPower (0,-100);
// Sleep3MS(200);
SetMotorPower (100,100);
}
else{//rechts
SetMotorPower (0,0);
// Sleep3MS(50);
SetMotorPower (-100,0);
// Sleep3MS(200);
SetMotorPower (100,100);
}
}
else{
SetMotorPower (100,100);
// Sleep3MS(30);
}
}
}
//void Sleep3MS(short b){
//short t;
// for(t=0;t<=b;t++){
// Sleep(216);
// }
//}
also so, dass es keine fehler bringt:
Build succeeded with 0 Warnings...
muss man den makefile noch mal extern starten oder ist noch etwas falsch eingestellt???
Lesezeichen