Added lot's of code-files used during work

This commit is contained in:
sicarius 2007-02-11 19:03:00 +00:00
parent 1a6b28b1c2
commit 05c8b0af60
30 changed files with 2599 additions and 0 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,78 @@
#include "global.h"
#include "hal/keylcd.h"
#include "navigation.h"
#include "sensor/sensor.h"
Board board;
KeyLCD keylcd;
Navigation navigation;
Sensor sensor;
int main() {
//board.ledOn();
sleep(1);
int speed = 255;
/*for(int i=-255;i<=255;i+=30) {
board.motor(0,i);
board.motor(1,i);
board.motor(2,i);
board.motor(3,i);
sleep(1);
}*/
board.motor(0, speed);
board.motor(1, speed);
board.motor(2, speed);
board.motor(3, speed);
PORTB |= (1 << PB5) | (1 << PB7); // Setze PWM-Ports auf high
PORTE |= (1 << PE3) | (1 << PE4);
/*sleep(10);
board.motor(0, 0);
board.motor(1, 0);
board.motor(2, 0);
board.motor(3, 0);*/
//while(true) { sleep(1); }
//board.beep(450);
//board.ledOn();
//keylcd.print("test");
//sleep(1);
//board.ledOff();
//sleep(1);
/*for(int i=0;i<keylcd.error();i++) {
board.ledOn();
sleep(1);
board.ledOff();
sleep(1);
}
board.ledOn();
uart1_puts("18");
uart1_puts("Hallo Du! Hier ist dein AtMega128\n");
sleep(1);
board.ledOff();
sleep(10);
//board.ledOff();
while(true) {
navigation.Aktualisieren(0,0,speed);
sleep(2);
navigation.Aktualisieren(90,0,speed);
sleep(2);
navigation.Aktualisieren(180,0,speed);
sleep(2);
navigation.Aktualisieren(270,0,speed);
sleep(2);
}*/
while(true)
{
//board.ledOn();
//sleep(1);
//board.ledOff();
sleep(1);
}
//for(int i=0;i<=7;i++) board.GetADC(i);
return 0;
}

View file

@ -0,0 +1,97 @@
###############################################################################
# Makefile for the project Soccer
###############################################################################
## General Flags
PROJECT = Soccer
MCU = atmega128
TARGET = Soccer.elf
CC = avr-g++.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=16000000ULUL -O3 -fsigned-char
CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d
## Assembly specific flags
ASMFLAGS = $(COMMON)
ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2
## Linker flags
LDFLAGS = $(COMMON)
LDFLAGS +=
## 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
## Objects that must be built in order to link
OBJECTS = Soccer.o board.o keylcd.o i2c.o global.o uart.o navigation.o sensor.o ballsensor.o
## Objects explicitly added by the user
LINKONLYOBJECTS =
## Build
all: $(TARGET) Soccer.hex Soccer.eep size
## Compile
Soccer.o: ../Soccer.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
board.o: ../hal/board.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
keylcd.o: ../hal/keylcd.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
i2c.o: ../hal/i2c.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
global.o: ../global.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
uart.o: ../hal/uart.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
navigation.o: ../navigation.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
sensor.o: ../sensor/sensor.c
$(CC) $(INCLUDES) $(CFLAGS) -c $<
ballsensor.o: ../sensor/ballsensor.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 $< $@
%.lss: $(TARGET)
avr-objdump -h -S $< > $@
size: ${TARGET}
@echo
@avr-size -C --mcu=${MCU} ${TARGET}
## Clean target
.PHONY: clean
clean:
-rm -rf $(OBJECTS) Soccer.elf dep/* Soccer.hex Soccer.eep
## Other dependencies
-include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*)

Binary file not shown.

View file

@ -0,0 +1,476 @@
:100000000C945B000C9483000C9483000C9483008C
:100010000C9483000C9483000C9483000C94830054
:100020000C9483000C9483000C9483000C94830044
:100030000C9483000C9483000C9483000C94830034
:100040000C9499010C9483000C9444040C94750452
:100050000C9483000C9483000C9483000C94830014
:100060000C9483000C9483000C9483000C94830004
:100070000C9483000C9483000C94E2040C941505FA
:100080000C9483000C9483000C9483000829573F40
:100090009F2D49CBA5310F76C73493F27E37D00D13
:1000A000013AB60B613D2AAAAB3F0000003F800039
:1000B0000000BA00B30011241FBECFEFD0E1DEBFB5
:1000C000CDBF11E0A0E0B1E0E0EAFDE100E00BBF50
:1000D00002C007900D92A031B107D9F711E0A0E15D
:1000E000B1E001C01D92AA3AB107E1F710E0C4EBFC
:1000F000D0E004C02297FE010E94770DC23BD107D9
:10010000C9F70C94C1000C9400008130910531F0C6
:10011000892B19F46F5F7F4FA9F008956F5F7F4FB0
:10012000E1F780E191E00E94E00181E191E00E942D
:100130009E0283E191E00E94D90689E191E00E944C
:100140000107089589E191E00E94FB0683E191E0B7
:100150000E940B0681E191E00E944F0280E191E054
:100160000E94090108956FEF7FEF80E090E00E9408
:10017000850008956FEF7FEF81E090E00E94850099
:10018000089580E090E0A0E0B0E000000196A11D9D
:10019000B11D8E3E22E7920725E1A20720E0B207BB
:1001A000A1F74FEF50E060E070E080E191E00E9445
:1001B00031014FEF50E061E070E080E191E00E949A
:1001C00031014FEF50E062E070E080E191E00E9489
:1001D00031014FEF50E063E070E080E191E00E9478
:1001E000310188B3806A88BB83B1886183B980E0BC
:1001F00090E0A0E0B0E000000196A11DB11D8E3E90
:1002000022E7920725E1A20720E0B207A1F7EFCF8E
:100210000895089586E886B967B987B1806C87B973
:10022000369A3699FECF40E020E030E0369A369993
:10023000FECF84B195B1280F391F4F5F4330B1F71E
:100240003798C90163E070E00E942A0DCB01089540
:1002500070931B0160931A010895C19A0895C19883
:1002600008956430710500F5CA0157FD36C08896BF
:100270008F3F910509F01CF561157105B1F06130F2
:10028000710581F16230710501F16330710561F42E
:10029000909379008093780014161506D4F5C29ACD
:1002A000C3980895C29AC39A089590938700809343
:1002B00086001416150604F5959A949808958FEF04
:1002C00090E061157105D9F6F0CF9BBD8ABD14167B
:1002D000150624F5C09AC198089588279927841B8C
:1002E000950BC5CF90938500809384001416150656
:1002F0005CF4969A97980895452B19F4949A959AD8
:100300000895949A95980895452B69F0979A969830
:100310000895452B39F2C39AC2980895452B31F0C0
:10032000C19AC0980895969A979A0895C19AC09ACA
:1003300008951F920F920FB60F9211242F933F939F
:100340008F939F93209100013091010180911A01B8
:1003500090911B0197FD23C0959587958217930770
:100360007CF48091650084608093650021153105DF
:1003700079F48FEF90E0909301018093000111C018
:10038000809165008B7F809365002115310589F38D
:1003900021503040309301012093000102C00196AA
:1003A000DBCF9F918F913F912F910F900FBE0F90B8
:1003B0001F901895662311F0C1980895C19A089569
:1003C0008EE78ABB1BBA9FEF97BB82E088BB94BBCA
:1003D00015BA8CEF81BB23E022BB8FED82B913B835
:1003E00010926100909362008FE1809364002093EB
:1003F000650088E290E09093870080938600949A4D
:10040000959A9093850080938400969A979A9BBDC5
:100410008ABDC19AC09A9093790080937800C29A5D
:10042000C39A8AE090E00E943F05789408958EE791
:100430008ABB1BBA9FEF97BB82E088BB94BB15BAFF
:100440008CEF81BB23E022BB8FED82B913B81092F1
:100450006100909362008FE18093640020936500B7
:1004600088E290E09093870080938600949A959A12
:100470009093850080938400969A979A9BBD8ABD3D
:10048000C19AC09A9093790080937800C29AC39AD7
:100490008AE090E00E943F057894089508950895B9
:1004A00008950E94BA0299270895CF92DF92EF92A1
:1004B000FF920F931F93CF93DF93CDB7DEB78C01DD
:1004C000FB01EDB6FEB6DB010D900020E9F76D01F2
:1004D0000894C108D108C61AD70AC60101962DB7DB
:1004E0003EB7281B390B0FB6F8943EBF0FBE2DBF89
:1004F0004DB75EB74F5F5F4F1C141D0464F420E0DE
:1005000030E0BA018191DB018D93BD012F5F3F4F38
:10051000C216D306B9F7960162E0C8010E94E7034C
:100520000FB6F894FEBE0FBEEDBEDF91CF911F91C6
:100530000F91FF90EF90DF90CF9008950E94AF024F
:1005400008950E94AF020895FC0180E4809370003A
:1005500084E4809374001092710010820895FC016D
:1005600080E48093700084E48093740010927100A2
:1005700010820895FC01808199270895660F609389
:100580007200089580917400992787FD90958827BF
:10059000990F881F99270895FC0190E020E030E032
:1005A000660F44EC80917400806A8093740080919F
:1005B000740087FFFCCF80917100887F883001F53F
:1005C00060937300409374008091740087FFFCCFA8
:1005D00080917100887F883189F080917100887FD7
:1005E000803221F09923F1F2108208952F5F3F4F5E
:1005F0002A303105B9F781E08083089591E0EDCF8D
:1006000082E080830895660F616024EC809174001D
:10061000806A809374008091740087FFFCCF809182
:10062000710060937300209374008091740087FFC1
:10063000FCCF809171009091710080917100809148
:100640007400806880937400987F9034F9F6089560
:100650006093730084EC809374008091740087FF32
:10066000FCCF8091710080917100089584ED80939A
:100670007400089584EC809374008091740087FF67
:10068000FCCF20E030E094ECFB0180917100887F8A
:10069000803889F4809173008083909374008091F6
:1006A000740087FFFCCF2F5F3F4F31968091710020
:1006B000887F803879F38091710084EC8093740096
:1006C000C9010895FB018091740087FFFCCF8091E0
:1006D00071008091710080917300808384EC80931D
:1006E000740008951F93141615060CF5DA0111977E
:1006F00020E030E014E894ECFB01808180937300EB
:10070000A217B30789F0909374008091740087FF5B
:10071000FCCF80917100809171002F5F3F4F319627
:100720004217530751F703C010937400EECF84ECC7
:10073000809374001F910895FC01660F616074EC52
:1007400080917400806A809374008091740087FFA8
:10075000FCCF80917100609373007093740080915E
:10076000740087FFFCCF809171009091710080919F
:10077000710080917400806880937400987F903439
:10078000F9F680818823E9F412161306B4F460E0C8
:1007900070E094ECFA018091740087FFFCCF8091A7
:1007A0007100809171008091730081939093740027
:1007B0006F5F7F4F2617370771F784ED80937400C2
:1007C000089584ED8093740083E080830895DC01B4
:1007D00090E0E0E0F0E0660F74EC80917400806AD5
:1007E000809374008091740087FFFCCF809171002A
:1007F000887F8830E9F5609373007093740080916E
:10080000740087FFFCCF80917100887F883171F17F
:1008100080917100887F803211F19923F1F21C924E
:1008200012161306BCF460E070E094ECFA018081CB
:1008300080937300909374008091740087FFFCCFC5
:1008400080917100809171006F5F7F4F3196261704
:10085000370769F784ED809374001C9208953196F0
:10086000EA30F105D1F681E08C9304C091E0D0CF5D
:1008700082E08C9384ED8093740008950E94D40CE0
:1008800008950E94310C08951F920F920FB60F9297
:1008900011242F933F934F938F939F93EF93FF9345
:1008A0003BB14CB1209183012F5F2F718091840166
:1008B000E22FFF279927E817F90741F0832F887166
:1008C00020938301EB57FE4F408301C082E0809369
:1008D000A501FF91EF919F918F914F913F912F91A2
:1008E0000F900FBE0F901F9018951F920F920FB68A
:1008F0000F9211248F939F93EF93FF939091610137
:1009000080916201981761F0E0916201EF5FEF71F1
:10091000E0936201FF27ED59FE4F80818CB901C041
:100920005598FF91EF919F918F910F900FBE0F906F
:100930001F9018959C011092610110926201109213
:1009400083011092840197FF03C082E08BB93F7747
:10095000832F99278093900029B988E98AB986E086
:100960008093950008959091830180918401981758
:1009700091F0E0918401EF5FEF71E0938401FF2734
:10098000EB57FE4F20818091A5019927982F88274A
:10099000820F911D089580E091E00895382F2091F5
:1009A00061012F5F2F71E22FFF278091620199274C
:1009B0008E179F07D1F3ED59FE4F308320936101CD
:1009C000559A08951F920F920FB60F9211242F93EC
:1009D0003F934F938F939F93EF93FF9330919B009F
:1009E00040919C0020913E012F5F2F7180913F012B
:1009F000E22FFF279927E817F90741F0832F887125
:100A000020933E01E05CFE4F408301C082E0809372
:100A10006001FF91EF919F918F914F913F912F91A5
:100A20000F900FBE0F901F9018951F920F920FB648
:100A30000F9211248F939F93EF93FF9390911C013A
:100A400080911D01981769F0E0911D01EF5FEF7132
:100A5000E0931D01FF27E25EFE4F808180939C00A2
:100A600005C080919A008F7D80939A00FF91EF914D
:100A70009F918F910F900FBE0F901F9018959C0122
:100A800010921C0110921D0110923E0110923F0124
:100A900097FF04C082E080939B003F77832F9927C4
:100AA000809398002093990088E980939A0086E0CB
:100AB00080939D00089590913E0180913F01981789
:100AC00091F0E0913F01EF5FEF71E0933F01FF276D
:100AD000E05CFE4F2081809160019927982F882744
:100AE000820F911D089580E091E00895382F2091A4
:100AF0001C012F5F2F71E22FFF2780911D01992785
:100B00008E179F07D1F3E25EFE4F308320931C01C6
:100B100080919A00806280939A000895DC013C9154
:100B20003323D1F0119620911C012F5F2F71E22FFA
:100B3000FF2780911D019927E817F907D1F3E25E9D
:100B4000FE4F308320931C0180919A008062809335
:100B50009A003C91332331F70895FC018491882356
:100B6000D1F0AF014F5F5F4F382F209161012F5FB0
:100B70002F71E22FFF27809162019927E817F9076B
:100B8000D1F3ED59FE4F308320936101559AFA015C
:100B90008491882339F70895DC013C913323B1F027
:100BA0001196209161012F5F2F71E22FFF27809115
:100BB00062019927E817F907D1F3ED59FE4F308309
:100BC00020936101559A3C91332351F70895FC011C
:100BD00084918823F1F0AF014F5F5F4F382F209150
:100BE0001C012F5F2F71E22FFF2780911D01992794
:100BF000E817F907D1F3E25EFE4F308320931C0122
:100C000080919A00806280939A00FA0184918823EF
:100C100019F7089508950895FC017183608308957C
:100C2000FC01738362830895FC01758364830895D6
:100C30002F923F924F925F926F927F928F929F92EC
:100C4000AF92BF92CF92DF92EF92FF920F931F93DA
:100C50004C01FC0160817181882777FD8095982F78
:100C60000E94B7095B016C010E94180E0E94200AC5
:100C70007B018C0189E191E00E94F806F401228158
:100C800033813C01621A730A662777276E197F0940
:100C9000882777FD8095982F0E94B7091B012C01AA
:100CA000C601B5010E947B0D0E94200A882777FDAE
:100CB0008095982F0E94B7095B016C01B7018827C6
:100CC00077FD8095982F0E94B7090E94200AF401B1
:100CD00024813581629FA001639F500D729F500D4A
:100CE0001124460D571D00E111E060E070E0C801DD
:100CF0000E94310127ED33EB4DED5FE3C601B501F5
:100D00000E9499089B01AC01C201B1010E946C08CC
:100D100020E030E040E05FE30E9499080E94200A52
:100D2000F40124813581629FA001639F500D729F61
:100D3000500D1124460D571D61E070E0C8010E945E
:100D4000310127ED33EB4DED5FEBC601B5010E949C
:100D500099089B01AC01C201B1010E946C0820E01E
:100D600030E040E05FE30E9499080E94200AF4010D
:100D700024813581629FA001639F500D729F500DA9
:100D80001124460D571D62E070E0C8010E94310138
:100D90001F910F91FF90EF90DF90CF90BF90AF9099
:100DA0009F908F907F906F905F904F903F902F908B
:100DB0000895FC011182108213821282158214821E
:100DC0000E9418060895FC0111821082138212827B
:100DD000158214820E9418060895FC0171836083B5
:100DE00053834283358324830E941806089508950F
:100DF00080E090E008950E940A0708950E940A0783
:100E000008950E94080708950E940807089508950C
:100E100008950895089580E090E00895A0E0B0E07E
:100E2000E4E1F7E00C94420DFC016A0190819230FC
:100E300008F41BC1DB018C91823080F0943061F4A6
:100E4000843009F012C19181EB018981981709F46E
:100E50000CC1E2E0F1E009C1843011F4FB0105C1ED
:100E6000823091F4923009F000C1EA01DF0188E09C
:100E70000D9009928150E1F78181FB0191818923D5
:100E8000E6018983F601F1C0923041F362807380FC
:100E9000EB018A809B80E480F580068117812C819C
:100EA0003D814E815F815301A818B908C501B7FC87
:100EB000ABC080970CF457C0861497040CF4BEC0E6
:100EC0003401EE24FF2487019181FB018181981771
:100ED00009F4A6C0992309F49CC02E193F09400BC0
:100EE000510B57FDB0C0E60119827B826A82F60180
:100EF0002483358346835783E6012C813D814E81CF
:100F00005F8179018A01DA01C9010197A109B1095B
:100F10008F5F9F4FAF4FBF43F8F4E6016A817B813B
:100F2000A8019701220F331F441F551F61507040C5
:100F300079018A01DA01C9010197A109B1098F5F1D
:100F40009F4FAF4FBF4360F3E6017B836A83F60197
:100F5000248335834683578383E0D6018C9357FDE2
:100F600039C0F60182C086149704B4F4C0E0D0E022
:100F7000DA01C90181709070A070B07056954795E4
:100F800037952795282B392B4A2B5B2B2196AC16AE
:100F9000BD0671F78A0C9B1C681479040CF094CF81
:100FA000C0E0D0E05401A618B708D801C70181708D
:100FB0009070A070B07016950795F794E794E82AA2
:100FC000F92A0A2B1B2B2196AC16BD0671F76A0C69
:100FD0007B1C7ACFDA01C901B695A79597958795BD
:100FE0002170307040705070282B392B4A2B5B2BAE
:100FF000E6012C833D834E835F838A819B8101962A
:101000009B838A83F60131C0882799278A199B0917
:1010100050CFE21AF30A040B150BA801970161CF18
:10102000E60199837B826A822E0D3F1D401F511F6E
:10103000F60124833583468357838ECF20E030E04A
:1010400040E050E041CF81E0E60189837B826A8203
:1010500050954095309521953F4F4F4F5F4FF6018A
:10106000248335834683578347CFCF01EEE0CDB746
:10107000DEB70C945E0DA0E2B0E0E1E4F8E00C9481
:101080004A0D69837A838B839C832D833E834F83B0
:10109000588789E1E82EF12CEC0EFD1EB701CE0138
:1010A00001960E94920B8E010F5E1F4FB801CE0178
:1010B00005960E94920B8A8991E089278A8BAE015E
:1010C000475F5F4FB801C7010E940E070E94700A78
:1010D000E6E0A0960C94660DA0E2B0E0E2E7F8E04E
:1010E0000C944A0D69837A838B839C832D833E8382
:1010F0004F83588799E1E92EF12CEC0EFD1EB701C4
:10110000CE0101960E94920B8E010F5E1F4FB80117
:10111000CE0105960E94920BAE01475F5F4FB8016A
:10112000C7010E940E070E94700AE6E0A0960C9488
:10113000660DA0E2B0E0EFE9F8E00C943E0D6983A3
:101140007A838B839C832D833E834F8358878E01C4
:10115000075E1F4FB801CE0101960E94920BF1E18C
:10116000EF2EF12CEC0EFD1EB701CE0105960E946C
:10117000920B898D823078F09989923040F420E08A
:101180009A8D8A89981321E02A8BB701E9C08430AF
:1011900051F4923061F020E09A8D8A89981321E011
:1011A0002A8FB801DDC0943029F4823041F762E023
:1011B00071E0D6C0823079F3923009F32D8D3E8DE7
:1011C0004F8D58A18D899E89AF89B88D22243324F3
:1011D0002101AA24BB246501EE24FF24870160E0DD
:1011E00070E00DC06F5F7F4F6032710599F1880F1D
:1011F000991FAA1FBB1F569547953795279520FF26
:1012000019C0280E391E4A1E5B1E6624772443012E
:10121000281639064A065B0628F4E1E06E2E712C8A
:10122000812C912CAE0CBF1CC01ED11EA60CB71C6D
:10123000C81CD91CEE0CFF1C001F111FB7FFD2CF1A
:10124000E1E06E2E712C812C912CE628F7280829DC
:101250001929C8CF8B8D9C8D2B893C89820F931FB8
:1012600002969C878B871A869A8D8A89981711F027
:1012700081E08A87D7FE17C08B859C85A0FE0CC0B5
:10128000569447943794279420E030E040E050E8AB
:10129000222A332A442A552AD694C794B794A7946D
:1012A00001969C878B8730E0A31630E0B30630E0D0
:1012B000C30630E4D30618F58B859C850EC0220C3E
:1012C000331C441C551C019720E0A21620E0B206F6
:1012D00020E0C20620E4D20680F4AA0CBB1CCC1C81
:1012E000DD1C57FEECCF31E0632E712C812C912C4C
:1012F000A628B728C828D928E2CF9C878B87D60193
:10130000C5018F779070A070B07080349105A105F1
:10131000B10551F0AD86BE86CF86D88A83E0898735
:10132000BE01675F7F4F1CC0A7FCF4CF21143104BE
:101330004104510479F380E490E0A0E0B0E0A80E0D
:10134000B91ECA1EDB1E80E8682E8FEF782E8FEF45
:10135000882E8FEF982EA620B720C820D920DACF6C
:10136000CB010E94700AE2E1A0960C945A0DA8E00D
:10137000B0E0EDEBF9E00C944D0D9B01AC0183E086
:1013800089831A8257FD51C0211531054105510548
:1013900039F482E08983CE0101960E94700A4CC024
:1013A000EEE1F0E0FC83EB838A818823C9F12030F1
:1013B00010E0310710E0410710E85107C9F1882714
:1013C0009927DC01821B930BA40BB50B8D839E83A5
:1013D000AF83B8872D813E814F815885203080E0D2
:1013E000380780E0480780E45807A8F6EB81FC81C5
:1013F000DA01C901880F991FAA1FBB1F31979C01F1
:10140000AD01803010E0910710E0A10710E4B107B2
:1014100078F3FC83EB838D839E83AF83B887BBCF48
:101420002D833E834F835887D5CF81E08A83ACCF0D
:1014300060E070E080E09FECE3E028960C94690D9A
:10144000ACE0B0E0E6E2FAE00C944E0D69837A83FA
:101450008B839C83BE016B5F7F4FCE0101960E9400
:10146000920B8D81823061F0823050F0843069F4CB
:101470008E81882359F52FEF3FEF4FEF5FE72AC0AA
:1014800020E030E040E050E025C02F81388537FD76
:10149000F7CF2F31310564F78EE190E0821B930B7B
:1014A00029853A854B855C8504C0569547953795C7
:1014B00027958A95D2F78E81882361F050954095C3
:1014C000309521953F4F4F4F5F4F04C020E030E0F3
:1014D00040E050E8CA01B901E2E02C960C946A0D94
:1014E0004F925F926F927F928F929F92AF92BF9234
:1014F000DF92EF92FF920F931F9320E030E040E0E5
:1015000050E0FC01E480F58006811781D180808164
:10151000823038F4D801C701A061AF77B0706FEFA7
:10152000D9C0843009F46EC0823009F471C0E1146E
:10153000F1040105110509F46BC0828193816FEFFD
:10154000823896070CF06AC062E87FEF681B790B5F
:101550006A3171050CF080C047015801062E04C0A5
:10156000B694A794979487940A94D2F74424552468
:10157000320181E090E0A0E0B0E004C0880F991F44
:10158000AA1FBB1F6A95D2F70197A109B109E822EA
:10159000F9220A231B23E114F1040105110529F0A6
:1015A00061E0462E512C612C712C85017401E428D8
:1015B000F52806291729D801C7018F779070A070E8
:1015C000B07080349105A105B10509F457C0D80168
:1015D000C701CF96A11DB11D60E070E08030E0E052
:1015E0009E07E0E0AE07E0E4BE0710F061E070E0C7
:1015F00027E0B695A795979587952A95D1F7AF7768
:10160000B07068C080E090E0A0E0B0E06FEF62C032
:1016100080E090E0A0E0B0E060E05CC08038910540
:101620008CF7BC0161587F4FD801C7018F7790704C
:10163000A070B07080349105A105B105A1F08FE3D1
:1016400090E0A0E0B0E0E80EF91E0A1F1B1F17FD96
:1016500028C0D801C701CCCF60E070E080E090E006
:10166000A0E0B0E0CCCFE7FEF2CF80E490E0A0E0D5
:10167000B0E0E80EF91E0A1F1B1FE9CFE7FC18C0F7
:1016800080E090E060E0E61660E0F60660E00607C5
:1016900060E4160710F081E090E0BC01D801C701BA
:1016A000A7CF16950795F794E7946F5F7F4FD1CF3B
:1016B000D801C701805C9F4FAF4FBF4F60E070E023
:1016C0008030E0E09E07E0E0AE07E0E4BE0708F40B
:1016D0008FCF8CCF282F392F9A2F9F77842F807808
:1016E000892B962F9795992797958F77482F492B78
:1016F0006695852F8078862BD794DD24D7948F77B5
:10170000582F5D29CA01B9011F910F91FF90EF90E9
:10171000DF90BF90AF909F908F907F906F905F9081
:101720004F900895FC01DB01208131819281492F86
:101730004F7750E0991F9927991F8381682F660F73
:10174000692B881F8827881FFD018183662309F084
:1017500049C0211531054105510509F470C082E8E1
:101760009FEFFD0193838283220F331F441F551F78
:10177000220F331F441F551F220F331F441F551FB5
:10178000220F331F441F551F220F331F441F551FA5
:10179000220F331F441F551F220F331F441F551F95
:1017A00083E08C932030F0E03F07F0E04F07F0E457
:1017B0005F0790F482E89FEF220F331F441F551FED
:1017C0000197203060E0360760E0460760E4560786
:1017D00098F3FD0193838283FD012483358346833F
:1017E000578308956F3F71F1862F99278F57904047
:1017F000FD019383828383E08C93220F331F441F68
:10180000551F220F331F441F551F220F331F441F24
:10181000551F220F331F441F551F220F331F441F14
:10182000551F220F331F441F551F220F331F441F04
:10183000551F50642483358346835783089582E07F
:101840008C930895211531054105510519F484E063
:101850008C93089544FD02C01C92BECF81E08C930E
:10186000BBCFCF93DF93AC01029710F442E050E07E
:10187000A091A801B091A901FD01C0E0D0E020E055
:1018800030E020C0808191818417950769F48281BE
:101890009381209719F09B838A8304C09093A901B8
:1018A0008093A801CF0132C04817590738F4211599
:1018B000310519F08217930708F49C01EF010280AB
:1018C000F381E02D3097F1F62115310589F1C90139
:1018D000841B950B049708F4A901E0E0F0E026C012
:1018E0008D919C91119782179307E9F44817590736
:1018F00079F4ED018A819B81309719F0938382837B
:1019000004C09093A9018093A801CD01029649C01B
:10191000841B950BFD01E80FF91F4193519302972A
:101920008D939C933AC0FD01A281B3811097C1F6BB
:101930008091A6019091A701892B41F480910C011F
:1019400090910D019093A7018093A60120910E0123
:1019500030910F012115310541F42DB73EB780912B
:101960000A0190910B01281B390BE091A601F0911F
:10197000A7012E1B3F0B2417350788F0CA010296DA
:101980002817390760F0CF01840F951F02969093B6
:10199000A7018093A60141935193CF0102C080E03B
:1019A00090E0DF91CF910895CF93DF93009709F4F2
:1019B0004EC0EC0122971B821A82A091A801B0911F
:1019C000A901109711F140E050E001C0DC01AC1713
:1019D000BD0700F1BB83AA83FE0121913191E20F83
:1019E000F31FEA17FB0771F42E5F3F4F8D919C9117
:1019F0001197820F931F99838883FD0182819381C0
:101A00009B838A834115510559F4D093A901C09352
:101A1000A8011DC0FD0182819381AD010097B1F63F
:101A2000FA01D383C28321913191E20FF31FEC17A6
:101A3000FD0769F42E5F3F4F88819981820F931FC4
:101A4000FA01918380838A819B8193838283DF91D2
:101A5000CF910895AA1BBB1B51E107C0AA1FBB1F52
:101A6000A617B70710F0A61BB70B881F991F5A952A
:101A7000A9F780959095BC01CD0108952F923F92D2
:101A80004F925F926F927F928F929F92AF92BF928E
:101A9000CF92DF92EF92FF920F931F93CF93DF933A
:101AA000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBE97
:101AB000CDBF09942A88398848885F846E847D84E4
:101AC0008C849B84AA84B984C884DF80EE80FD80E6
:101AD0000C811B81AA81B981CE0FD11D0FB6F8945C
:101AE000DEBF0FBECDBFED010895EE0FFF1F0590C5
:101AF000F491E02D099450E449EC3FE02BED01D046
:101B000013C05F77552319F444230AF02BC02F9399
:101B10003F934F935F93A3D05527442759D05F91AC
:101B20004F913F912F9105CB1F939F7750EC49E444
:101B30003FE02BEDD1DA10E89F775FE349EC3FE01F
:101B40002BED621773078407950720F050EC49E4EA
:101B5000C3DA112780D09068ECE8F0E006D0912736
:101B60001F9108959FEF80EC0895FF92EF92DF920E
:101B7000CF92BF926B017C01B59016D0B590BB207F
:101B800069F09F938F937F936F93B601C7010CD039
:101B90002F913F914F915F910E942F0EBF90CF9058
:101BA000DF90EF90FF900895A0D002C09601A701AA
:101BB000EF93FF930E949908FF91EF9196D0EF93D6
:101BC000FF930E946C08FF91EF91BA9479F7089502
:101BD000C8D0CF93DF93D52FC42F55274427332761
:101BE00022279923D9F09F37C8F0F92F88D0592F91
:101BF000482F372F262FF63968F422DCB8DBC030A7
:101C0000CD0721F069937993899399939058DF9147
:101C1000CF9162CA9927882777276627C030CD07DA
:101C200021F02993399349935993DF91CF9167C05C
:101C30009F939F77993358F050E449EC3FE02BEDA8
:101C400060DF5FEB49EC3FE02BED46DA6DDF5F9143
:101C50005078952708959B01AC010C94990867D0A2
:101C600001D04DC0552359F0992369F09F575F5714
:101C7000951B33F442F4903811F4915805C072CF9B
:101C800091589F3F09F47FC0BB2711246217730747
:101C9000840730F4660F771F881FBB1F915098F39D
:101CA00011D00F920FD00F920DD0A0E82617370752
:101CB00048071B0609F0A048BA2F602D7F918F912D
:101CC00000240895A0E80024621773078407B10573
:101CD00028F0621B730B840BB1090A2A660F771F69
:101CE000881FBB1FA69581F70895559145913591A1
:101CF000259108959A95BB0F661F771F881F1124A1
:101D00009923A1F08823B2F79F3F59F0BB0F48F405
:101D100021F4002011F460FF04C06F5F7F4F8F4FEC
:101D20009F4F881F9795879597F9089529C0052E8D
:101D3000092607FA440F551F5F3F79F0AA27A51718
:101D400008F051E04795880F991F9F3F31F0BB275E
:101D5000B91708F091E0879508959F919F911124FC
:101D600001CF97FB880F991F9F3F31F0BB27B91711
:101D700008F091E0879508959F919F911124F2CEEC
:101D80006627772788279927089510E0C4EBD0E0CD
:101D900004C0FE010E94770D2296C63BD107C9F709
:101DA000FF0000000000000000002000AA01000069
:00000001FF

View file

@ -0,0 +1,66 @@
Soccer.o: ../Soccer.c ../global.h c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h ../hal/board.h \
c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h ../hal/uart.h \
../hal/keylcd.h ../hal/i2c.h ../hal/../global.h \
c:/winavr/bin/../avr/include/compat/twi.h \
c:/winavr/bin/../avr/include/util/twi.h \
c:/winavr/bin/../avr/include/string.h ../navigation.h \
c:/winavr/bin/../avr/include/math.h ../sensor/sensor.h \
../sensor/../hal/board.h ../sensor/ballsensor.h ../sensor/../global.h
../global.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
../hal/uart.h:
../hal/keylcd.h:
../hal/i2c.h:
../hal/../global.h:
c:/winavr/bin/../avr/include/compat/twi.h:
c:/winavr/bin/../avr/include/util/twi.h:
c:/winavr/bin/../avr/include/string.h:
../navigation.h:
c:/winavr/bin/../avr/include/math.h:
../sensor/sensor.h:
../sensor/../hal/board.h:
../sensor/ballsensor.h:
../sensor/../global.h:

View file

@ -0,0 +1,38 @@
ballsensor.o: ../sensor/ballsensor.c ../sensor/ballsensor.h \
../sensor/../hal/board.h c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h \
../sensor/../hal/uart.h
../sensor/ballsensor.h:
../sensor/../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../sensor/../hal/uart.h:

View file

@ -0,0 +1,35 @@
board.o: ../hal/board.c ../hal/board.h \
c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h ../hal/uart.h
../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/uart.h:

View file

@ -0,0 +1,36 @@
global.o: ../global.c ../global.h c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h ../hal/board.h \
c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h ../hal/uart.h
../global.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
../hal/uart.h:

View file

@ -0,0 +1,45 @@
i2c.o: ../hal/i2c.c ../hal/i2c.h ../hal/../global.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h \
../hal/../hal/board.h c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h ../hal/../hal/uart.h \
c:/winavr/bin/../avr/include/compat/twi.h \
c:/winavr/bin/../avr/include/util/twi.h
../hal/i2c.h:
../hal/../global.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
../hal/../hal/uart.h:
c:/winavr/bin/../avr/include/compat/twi.h:
c:/winavr/bin/../avr/include/util/twi.h:

View file

@ -0,0 +1,50 @@
keylcd.o: ../hal/keylcd.c ../hal/keylcd.h ../hal/i2c.h ../hal/../global.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h \
../hal/../hal/board.h c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h ../hal/../hal/uart.h \
c:/winavr/bin/../avr/include/compat/twi.h \
c:/winavr/bin/../avr/include/util/twi.h \
c:/winavr/bin/../avr/include/string.h
../hal/keylcd.h:
../hal/i2c.h:
../hal/../global.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
../hal/../hal/uart.h:
c:/winavr/bin/../avr/include/compat/twi.h:
c:/winavr/bin/../avr/include/util/twi.h:
c:/winavr/bin/../avr/include/string.h:

View file

@ -0,0 +1,52 @@
navigation.o: ../navigation.c ../navigation.h \
c:/winavr/bin/../avr/include/math.h ../hal/board.h \
c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h ../hal/uart.h \
../sensor/sensor.h ../sensor/../hal/board.h ../sensor/ballsensor.h \
../sensor/../global.h ../sensor/../hal/board.h
../navigation.h:
c:/winavr/bin/../avr/include/math.h:
../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/uart.h:
../sensor/sensor.h:
../sensor/../hal/board.h:
../sensor/ballsensor.h:
../sensor/../global.h:
../sensor/../hal/board.h:

View file

@ -0,0 +1,45 @@
sensor.o: ../sensor/sensor.c ../sensor/sensor.h ../sensor/../hal/board.h \
c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h \
c:/winavr/bin/../avr/include/stdlib.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h \
../sensor/../hal/uart.h ../sensor/ballsensor.h ../sensor/../global.h \
../sensor/../hal/board.h
../sensor/sensor.h:
../sensor/../hal/board.h:
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
c:/winavr/bin/../avr/include/stdlib.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../sensor/../hal/uart.h:
../sensor/ballsensor.h:
../sensor/../global.h:
../sensor/../hal/board.h:

View file

@ -0,0 +1,32 @@
uart.o: ../hal/uart.c c:/winavr/bin/../avr/include/avr/io.h \
c:/winavr/bin/../avr/include/avr/sfr_defs.h \
c:/winavr/bin/../avr/include/inttypes.h \
c:/winavr/bin/../avr/include/stdint.h \
c:/winavr/bin/../avr/include/avr/iom128.h \
c:/winavr/bin/../avr/include/avr/portpins.h \
c:/winavr/bin/../avr/include/avr/version.h \
c:/winavr/bin/../avr/include/avr/interrupt.h \
c:/winavr/bin/../avr/include/avr/pgmspace.h \
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h ../hal/uart.h
c:/winavr/bin/../avr/include/avr/io.h:
c:/winavr/bin/../avr/include/avr/sfr_defs.h:
c:/winavr/bin/../avr/include/inttypes.h:
c:/winavr/bin/../avr/include/stdint.h:
c:/winavr/bin/../avr/include/avr/iom128.h:
c:/winavr/bin/../avr/include/avr/portpins.h:
c:/winavr/bin/../avr/include/avr/version.h:
c:/winavr/bin/../avr/include/avr/interrupt.h:
c:/winavr/bin/../avr/include/avr/pgmspace.h:
c:\winavr\bin\../lib/gcc/avr/4.1.1/include/stddef.h:
../hal/uart.h:

View file

@ -0,0 +1,10 @@
#include "global.h"
void *operator new(size_t sz) {
return malloc(sz);
};
void operator delete(void *p) {
free(p);
};

View file

@ -0,0 +1,35 @@
#ifndef _GLOBAL_H_
#define _GLOBAL_H_
#include <stdlib.h>
#include "hal/board.h"
inline void sleep(int sec)
{
for (int s=0; s<sec; s++) {
for (long int i=0; i<1405678; i++) {
asm volatile("nop");
}
}
};
void *operator new(size_t sz);
void operator delete(void *p);
/* defines for compatibility */
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
#ifndef BV
#define BV _BV
#endif
#endif

View file

@ -0,0 +1,210 @@
#include "board.h"
static int beepFreq = 0;
Board::Board() {
// Pin 1-6 sind ausgänge, 0 und 7 eingänge
DDRA = (1 << PA1) | (1 << PA2) | (1 << PA3) | (1 << PA4) | (1 << PA5) | (1 << PA6);
PORTA = 0; // Alle Low, kein Pollup
// Alle Ausgänge
DDRB = (1 << PB0) | (1 << PB1) | (1 << PB2) | (1 << PB3) | (1 << PB4) | (1 << PB5) | (1 << PB6) | (1 << PB7);
PORTB = (1 << PB1); // Alle Low bis PB1 , kein Pollup
// Alle Ausgänge
DDRC = (1 << PC0) | (1 << PC1) | (1 << PC2) | (1 << PC3) | (1 << PC4) | (1 << PC5) | (1 << PC6) | (1 << PC7);
PORTC = 0; // Alle Low, kein Pollup
// Alle Ausgänge bis auf PD0+1(I2C) + 2+3(RS232)
DDRD = (1 << PD2) | (1 << PD3) | (1 << PD4) | (1 << PD5) | (1 << PD6) | (1 << PD7);
PORTD = (1 << PD0) | (1 << PD1); // Pollup-Widerstand an PD0+1 aktivieren
// PE5 ist eingang
DDRE = (1 << PE0) | (1 << PE1) | (1 << PE2) | (1 << PE3) | (1 << PE4) | (1 << PE6) | (1 << PE7);
PORTE = 0; // Alle Low, kein Pollup
// Alle Eingänge mit Pollup
DDRF = 0;
PORTF = (1 << PF0) | (1 << PF1) | (1 << PF2) | (1 << PF3) | (1 << PF4) | (1 << PF5) | (1 << PF6) | (1 << PF7);
// Alle Ausgänge, PG0 und PG1 high
DDRG = (1 << PG0) | (1 << PG1) | (1 << PG2) | (1 << PG3) | (1 << PG4);
PORTG = (1 << PG0) | (1 << PG1);
// aktiviere Kanal A+C auf PWM1 mit 8Bit
//TCCR1A = (1<< COM1A1) | (1<< COM1C1) | (1<< WGM10);
//TCCR1B = (1<<ICNC1) | (1<<CS12) | (1<<CS10); // set clock/prescaler 1/1024 -> enable counter
// aktiviere Kanal A+B auf PWM3 mit 8Bit
//TCCR3A = (1<< COM3A1) | (1<< COM3B1) | (1<< WGM10);
//TCCR3B = (1<<ICNC3) | (1<<CS32) | (1<<CS30); // set clock/prescaler 1/1024 -> enable counter
// Schalte Motoren auf 0
motor(0,0);
motor(1,0);
motor(2,0);
motor(3,0);
// Uart-Interface einschalten
uart1_init( 10); // 9600 BAUD bei 16MHz Atmel
// aktiviere interrupt
sei();
}
Board::~Board() {
}
// Gibt einen Analogen Wert zurück
int Board::GetADC(uint8_t channel) {
uint8_t i;
uint16_t result = 0;
// Den ADC aktivieren und Teilungsfaktor auf 64 stellen
ADCSRA = (1<<ADEN) | (1<<ADPS2) | (1<<ADPS1);
// Kanal des Multiplexers waehlen
ADMUX = channel;
// Interne Referenzspannung verwenden (also 2,56 V)
ADMUX |= (1<<REFS1) | (1<<REFS0);
// Den ADC initialisieren und einen sog. Dummyreadout machen
ADCSRA |= (1<<ADSC);
while(ADCSRA & (1<<ADSC));
// Jetzt 3x die analoge Spannung and Kanal channel auslesen
// und dann Durchschnittswert ausrechnen.
for(i=0; i<3; i++) {
// Eine Wandlung
ADCSRA |= (1<<ADSC);
// Auf Ergebnis warten...
while(ADCSRA & (1<<ADSC));
result += ADCW;
}
// ADC wieder deaktivieren
ADCSRA &= ~(1<<ADEN);
result /= 3;
return result;
}
void Board::beep(int freq) {
beepFreq = freq;
}
void Board::ledOff() {
PORTB |= (1 << PB1); // set bit
}
void Board::ledOn() {
PORTB &= ~(1 << PB1); // clear bit
}
void Board::led(bool status) {
if(status) ledOn();
else ledOff();
}
void Board::motor(int i, int speed)
{
if((i < 0) || (i > 3)) return;
const int OFFSET = 40; // Motor does not work with very low ratio
const int PWM_MAX = 255;
int pwm = abs(speed)+OFFSET;
if(pwm > PWM_MAX) pwm = PWM_MAX;
if(i == 0)
{
MOTOR0_PWM = pwm;
if(speed > 0)
{
PORTD |= (1 << 5);//In 1 ein
PORTD &= ~(1 << 4);//In 2 aus
}
else if(speed < 0)
{
PORTD |= (1 << 4);//In 2 ein
PORTD &= ~(1 << 5);//In 1 aus
}
else
{
PORTD |= (1 << 4);//In 2 ein
PORTD |= (1 << 5);//In 1 ein
}
}
else if(i == 1)
{
MOTOR1_PWM = pwm;
if(speed > 0)
{
PORTD |= (1 << 6);//In 1 ein
PORTD &= ~(1 << 7);//In 2 aus
}
else if(speed < 0)
{
PORTD |= (1 << 7);//In 2 ein
PORTD &= ~(1 << 6);//In 1 aus
}
else
{
PORTD |= (1 << 6);//In 2 ein
PORTD |= (1 << 7);//In 1 ein
}
}
else if(i == 2)
{
MOTOR2_PWM = pwm;
if(speed > 0)
{
PORTB |= (1 << 0);//In 1 ein
PORTB &= ~(1 << 1);//In 2 aus
}
else if(speed < 0)
{
PORTB |= (1 << 1);//In 2 ein
PORTB &= ~(1 << 0);//In 1 aus
}
else
{
PORTB |= (1 << 1);//In 2 ein
PORTB |= (1 << 0);//In 1 ein
}
}
else if(i == 3)
{
DRIBBLER_PWM = pwm;
if(speed > 0)
{
PORTB |= (1 << 2);//In 1 ein
PORTB &= ~(1 << 3);//In 2 aus
}
else if(speed < 0)
{
PORTB |= (1 << 3);//In 2 ein
PORTB &= ~(1 << 2);//In 1 aus
}
else
{
PORTB |= (1 << 2);//In 2 ein
PORTB |= (1 << 3);//In 1 ein
}
}
}
//PWM routine für den Beeper
ISR (TIMER0_OVF_vect)
{
static int counter = 255;
if(counter > beepFreq/2) PORTG |= (1<<BEEPER_PIN);
else PORTG &= ~(1<<BEEPER_PIN);
if (counter==0) counter = 255;
else counter--;
}

View file

@ -0,0 +1,38 @@
#ifndef _BOARD_H_
#define _BOARD_H_
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdlib.h>
#include "uart.h"
//#define abs(a) ((a < 0)? -a : a)
#define BEEPER_PIN PG2
// Definiere PWM-Ports für die Motoren/Dribbler
#define MOTOR0_PWM OCR3A
#define MOTOR1_PWM OCR3B
#define MOTOR2_PWM OCR1A
#define DRIBBLER_PWM OCR1C
#define UART_BAUD_RATE 9600
class Board
{
private:
public:
Board();
~Board();
int GetADC(uint8_t channel);
void beep(int freq);
void ledOn();
void ledOff();
void led(bool status);
void motor(int i, int speed);
};
#endif

View file

@ -0,0 +1,217 @@
#include "i2c.h"
I2C::I2C()
{
TWBR = 64; // I2C bitrate (must be 10 or higher)
TWCR = 4+64; // TWI enable bit + ackn
TWSR = 0; // prescaler
// I2C pull-ups are set in the board file //
err=0;
}
uint8_t I2C::error()
{
return err;
}
void I2C::setSlaveAdress(uint8_t address)
{
TWAR = address<<1; // slave address (shift by one since bit 0 has different meaning)
}
bool I2C::isAction()
{
if (TWCR&(1<<TWINT)) return true;
else return false;
}
inline
bool I2C::isActionGet()
{
return ((TWSR&248)==TW_ST_SLA_ACK); // own I2C address received, read mode, ACK sent
}
inline
bool I2C::isActionSend()
{
return ((TWSR&248)==TW_SR_SLA_ACK); // own I2C address received, write mode, ACK sent
}
void I2C::sendStartSLA_W(uint8_t address)
{
bool OK = false;
int counter = 0;
do {
TWCR |= BV(TWINT)|BV(TWSTA); // send start condition
while(!(TWCR&BV(TWINT))); // wait for OK
if ((TWSR&248)!=TW_START) { // start condition was sent -> OK
err=ERROR_NO_START;
return;
}
TWDR=(address<<1); // slave address + write mode
TWCR = BV(TWINT) | BV(TWEN) | BV(TWEA); // generate command
while(!(TWCR&128)) {}; // wait for OK
if ((TWSR&248)==TW_MT_SLA_ACK) OK=true; // SLA+W was sent, ACK received -> OK
if ((TWSR&248)==TW_MT_SLA_NACK) { // SLA+W was sent, ACK not received -> ERROR
counter++;
if (counter == 10) { // After 10 tries...
err=ERROR_NO_ACK; // ... return with ERROR_NO_ACK
return;
}
}
} while(!OK);
err=0; // OK
}
void I2C::sendStartSLA_R(uint8_t address)
{
bool OK=false;
while (!OK) {
TWCR |= BV(TWINT)|BV(TWSTA); // send start condition
// sbi(TWCR, TWSTA); // generate start condition
while(!(TWCR&128)); // wait for OK
if ((TWSR&248)==8); // start condition was sent -> OK
TWDR=(address<<1) | 1; // slave address + read mode
TWCR = BV(TWINT) | BV(TWEN) | BV(TWEA); // generate command
while(!(TWCR&128)); // wait for send OK + ACK/NACK from slave
if ((TWSR&248)==0x38); // Arbitration lost or NOT ACK -> ERROR
if ((TWSR&248)==0x40) OK=true; // SLA+R was sent, ACK received -> OK
if ((TWSR&248)==0x48); // SLA+W was sent, ACK not received -> ERROR
sbi(TWCR, TWINT); // OK
}
}
// This is used by send() called by the master //
void I2C::sendByte(uint8_t data)
{
TWDR = data; // send one data byte
TWCR = (1<<TWINT)|(1<<TWEA)|(1<<TWEN); // start transmission
while(!(TWCR&(1<<TWINT))); // wait for TWCR to become 0
if ((TWSR&248)==TW_MT_DATA_ACK); // data sent, ACK received -> OK
if ((TWSR&248)==TW_MT_DATA_NACK); // data sent, ACK not received -> ERROR
}
void I2C::sendStop()
{
TWCR = BV(TWINT) | BV(TWEN) | BV(TWEA) | BV(TWSTO); // generate stop command
}
// Note: in qfix, the I2C address is the board identifier
// and the first data byte ist the logical ID
inline
void I2C::send(uint8_t address, uint8_t data)
{
send(address, &data, 1);
}
// Note: in qfix, the I2C address is the board identifier
// and the first data byte ist the logical ID
void I2C::send(uint8_t address, uint8_t* data, int length)
{
sendStartSLA_W(address);
if (err!=0)
{
sendStop();
//err = ERROR_NOT_SENT;
return;
}
for (int i=0; i<length; i++) {
sendByte(data[i]);
}
sendStop();
err = 0; // OK
}
int I2C::receive(uint8_t* data)
{
TWCR = (1<<TWINT)|(1<<TWEA)|(1<<TWEN);
while(!(TWCR&(1<<TWINT))); // wait for something
int len = 0;
while ((TWSR&248)==TW_SR_DATA_ACK) { // data received (in TWDR), ACK sent
data[len] = TWDR; // read received byte
len++;
TWCR = (1<<TWINT)|(1<<TWEA)|(1<<TWEN);
while(!(TWCR&(1<<TWINT))) { } // wait for OK
}
if ((TWSR&248)==TW_SR_STOP) { } // STOP (or new START) received -> OK
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA); // generate command
return len;
}
void I2C::readByte(uint8_t& data)
{
while(!isAction());
if ((TWSR&248)==0x50); // data received: NACK
if ((TWSR&248)==0x58); // data received: ACK
data = TWDR;
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA); // generate command
}
void I2C::get(uint8_t address, uint8_t* data, int length)
{
sendStartSLA_R(address);
if (err!=0)
{
sendStop();
err = ERROR_NOT_SENT;
return;
}
for (int i=0; i<length; i++) {
readByte(data[i]);
}
sendStop();
}
void I2C::returnBytes(uint8_t* data, int len, bool lastOne)
{
for (int i=0; i<len; i++) {
TWDR=data[i]; // byte to send
if (i==len-1) TWCR = (1<<TWINT) | (1<<TWEN); // command for last byte (no TWEA is correct!)
else TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA); // command for all others
while(!(TWCR&(1<<TWINT))); // wait for OK
if ((TWSR&248)==0xB8); // data sent, ACK ACK received -> OK
if ((TWSR&248)==0xC0); // data sent, ACK not received -> ERROR
}
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA); // generate command
}

View file

@ -0,0 +1,69 @@
#ifndef _IC2_H_
#define _I2C_H_
//------------------------------------------------------------------
// qfixI2C.h
//
// This class is used for low-level I2C communication.
//
// For TW_ constants see compat/twi.h
//
// Copyright 2005-2006 by KTB mechatronics GmbH
// Author: Stefan Enderle, Florian Schrapp
//------------------------------------------------------------------
#include "../global.h"
#include <compat/twi.h>
const int ACTION_SEND = 1;
const int ACTION_GET = 2;
const int ACTION_UNKNOWN = 3;
const uint8_t ERROR_NO_ACK = 1;
const uint8_t ERROR_NO_START = 2;
const uint8_t ERROR_NOT_SENT = 3; // send() could not send byte(s)
class I2C
{
private:
uint8_t err;
uint8_t adr;
void sendStartSLA_W(uint8_t address);
void sendStartSLA_R(uint8_t address);
void sendByte(uint8_t data);
void sendStop();
void readByte(uint8_t& data);
public:
I2C();
uint8_t error();
// master side //
void send(uint8_t address, uint8_t data);
void send(uint8_t address, uint8_t* data, int length);
void get(uint8_t address, uint8_t* data, int length);
// slave side //
void setSlaveAdress(uint8_t address);
bool isAction();
bool isActionSend(); // true if master sent something
bool isActionGet(); // true if master wants to get something
int receive(uint8_t* data); // if action is send, receive the bytes
void returnBytes(uint8_t* data, int len, bool lastOne);
};
#endif

View file

@ -0,0 +1,28 @@
#include "keylcd.h"
KeyLCD::KeyLCD() : i2c() {
}
KeyLCD::~KeyLCD() {
}
// Gibt Daten auf dem keyLCD aus
void KeyLCD::print(char *data) {
int len=strlen(data);
uint8_t buf[len+1];
for (int i=0; i<len; i++) buf[i] = uint8_t(data[i]);
i2c.send(I2C_KEYLCD, buf, len);
}
// Löscht das keyLCD
void KeyLCD::clear() {
}
uint8_t KeyLCD::error() {
return i2c.error();
}

View file

@ -0,0 +1,25 @@
#ifndef _KEYLCD_H_
#define _KEYLCD_H_
#include "i2c.h"
#include "string.h"
#define I2C_KEYLCD 2
#define LCD_CMD_PRINTSTR 0
class KeyLCD
{
private:
I2C i2c;
public:
KeyLCD();
~KeyLCD();
void print(char* data);
uint8_t error();
void clear();
};
#endif

View file

@ -0,0 +1,585 @@
/*************************************************************************
Title: Interrupt UART library with receive/transmit circular buffers
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
File: $Id: uart.c,v 1.5.2.10 2005/11/15 19:49:12 peter Exp $
Software: AVR-GCC 3.3
Hardware: any AVR with built-in UART,
tested on AT90S8515 at 4 Mhz and ATmega at 1Mhz
DESCRIPTION:
An interrupt is generated when the UART has finished transmitting or
receiving a byte. The interrupt handling routines use circular buffers
for buffering received and transmitted data.
The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE variables define
the buffer size in bytes. Note that these variables must be a
power of 2.
USAGE:
Refere to the header file uart.h for a description of the routines.
See also example test_uart.c.
NOTES:
Based on Atmel Application Note AVR306
*************************************************************************/
#include <avr/io.h>
#include <avr/interrupt.h>
//#include <avr/signal.h>
#include <avr/pgmspace.h>
#include "uart.h"
/*
* constants and macros
*/
/* size of RX/TX buffers */
#define UART_RX_BUFFER_MASK ( UART_RX_BUFFER_SIZE - 1)
#define UART_TX_BUFFER_MASK ( UART_TX_BUFFER_SIZE - 1)
#if ( UART_RX_BUFFER_SIZE & UART_RX_BUFFER_MASK )
#error RX buffer size is not a power of 2
#endif
#if ( UART_TX_BUFFER_SIZE & UART_TX_BUFFER_MASK )
#error TX buffer size is not a power of 2
#endif
#if defined(__AVR_AT90S2313__) \
|| defined(__AVR_AT90S4414__) || defined(__AVR_AT90S4434__) \
|| defined(__AVR_AT90S8515__) || defined(__AVR_AT90S8535__) \
|| defined(__AVR_ATmega103__)
/* old AVR classic or ATmega103 with one UART */
#define AT90_UART
#define UART0_RECEIVE_INTERRUPT SIG_UART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_UART_DATA
#define UART0_STATUS USR
#define UART0_CONTROL UCR
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_AT90S2333__) || defined(__AVR_AT90S4433__)
/* old AVR classic with one UART */
#define AT90_UART
#define UART0_RECEIVE_INTERRUPT SIG_UART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_UART_DATA
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega8__) || defined(__AVR_ATmega16__) || defined(__AVR_ATmega32__) \
|| defined(__AVR_ATmega8515__) || defined(__AVR_ATmega8535__) \
|| defined(__AVR_ATmega323__)
/* ATmega with one USART */
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT SIG_UART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_UART_DATA
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega163__)
/* ATmega163 with one UART */
#define ATMEGA_UART
#define UART0_RECEIVE_INTERRUPT SIG_UART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_UART_DATA
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega162__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT SIG_USART0_RECV
#define UART1_RECEIVE_INTERRUPT SIG_USART1_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_USART0_DATA
#define UART1_TRANSMIT_INTERRUPT SIG_USART1_DATA
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
/* ATmega with two USART */
#define ATMEGA_USART0
#define ATMEGA_USART1
#define UART0_RECEIVE_INTERRUPT SIG_UART0_RECV
#define UART1_RECEIVE_INTERRUPT SIG_UART1_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_UART0_DATA
#define UART1_TRANSMIT_INTERRUPT SIG_UART1_DATA
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#define UART1_STATUS UCSR1A
#define UART1_CONTROL UCSR1B
#define UART1_DATA UDR1
#define UART1_UDRIE UDRIE1
#elif defined(__AVR_ATmega161__)
/* ATmega with UART */
#error "AVR ATmega161 currently not supported by this libaray !"
#elif defined(__AVR_ATmega169__)
/* ATmega with one USART */
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT SIG_USART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_USART_DATA
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#elif defined(__AVR_ATmega48__) ||defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__)
#define ATMEGA_USART0
#define UART0_RECEIVE_INTERRUPT SIG_USART_RECV
#define UART0_TRANSMIT_INTERRUPT SIG_USART_DATA
#define UART0_STATUS UCSR0A
#define UART0_CONTROL UCSR0B
#define UART0_DATA UDR0
#define UART0_UDRIE UDRIE0
#elif defined(__AVR_ATtiny2313__)
#define ATMEGA_USART
#define UART0_RECEIVE_INTERRUPT SIG_USART0_RX
#define UART0_TRANSMIT_INTERRUPT SIG_USART0_UDRE
#define UART0_STATUS UCSRA
#define UART0_CONTROL UCSRB
#define UART0_DATA UDR
#define UART0_UDRIE UDRIE
#else
#error "no UART definition for MCU available"
#endif
/*
* module global variables
*/
static volatile unsigned char UART_TxBuf[UART_TX_BUFFER_SIZE];
static volatile unsigned char UART_RxBuf[UART_RX_BUFFER_SIZE];
static volatile unsigned char UART_TxHead;
static volatile unsigned char UART_TxTail;
static volatile unsigned char UART_RxHead;
static volatile unsigned char UART_RxTail;
static volatile unsigned char UART_LastRxError;
#if defined( ATMEGA_USART1 )
static volatile unsigned char UART1_TxBuf[UART_TX_BUFFER_SIZE];
static volatile unsigned char UART1_RxBuf[UART_RX_BUFFER_SIZE];
static volatile unsigned char UART1_TxHead;
static volatile unsigned char UART1_TxTail;
static volatile unsigned char UART1_RxHead;
static volatile unsigned char UART1_RxTail;
static volatile unsigned char UART1_LastRxError;
#endif
SIGNAL(UART0_RECEIVE_INTERRUPT)
/*************************************************************************
Function: UART Receive Complete interrupt
Purpose: called when the UART has received a character
**************************************************************************/
{
unsigned char tmphead;
unsigned char data;
unsigned char usr;
unsigned char lastRxError;
/* read UART status register and UART data register */
usr = UART0_STATUS;
data = UART0_DATA;
/* */
#if defined( AT90_UART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#elif defined( ATMEGA_USART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#elif defined( ATMEGA_USART0 )
lastRxError = (usr & (_BV(FE0)|_BV(DOR0)) );
#elif defined ( ATMEGA_UART )
lastRxError = (usr & (_BV(FE)|_BV(DOR)) );
#endif
/* calculate buffer index */
tmphead = ( UART_RxHead + 1) & UART_RX_BUFFER_MASK;
if ( tmphead == UART_RxTail ) {
/* error: receive buffer overflow */
lastRxError = UART_BUFFER_OVERFLOW >> 8;
}else{
/* store new index */
UART_RxHead = tmphead;
/* store received data in buffer */
UART_RxBuf[tmphead] = data;
}
UART_LastRxError = lastRxError;
}
SIGNAL(UART0_TRANSMIT_INTERRUPT)
/*************************************************************************
Function: UART Data Register Empty interrupt
Purpose: called when the UART is ready to transmit the next byte
**************************************************************************/
{
unsigned char tmptail;
if ( UART_TxHead != UART_TxTail) {
/* calculate and store new buffer index */
tmptail = (UART_TxTail + 1) & UART_TX_BUFFER_MASK;
UART_TxTail = tmptail;
/* get one byte from buffer and write it to UART */
UART0_DATA = UART_TxBuf[tmptail]; /* start transmission */
}else{
/* tx buffer empty, disable UDRE interrupt */
UART0_CONTROL &= ~_BV(UART0_UDRIE);
}
}
/*************************************************************************
Function: uart_init()
Purpose: initialize UART and set baudrate
Input: baudrate using macro UART_BAUD_SELECT()
Returns: none
**************************************************************************/
void uart_init(unsigned int baudrate)
{
UART_TxHead = 0;
UART_TxTail = 0;
UART_RxHead = 0;
UART_RxTail = 0;
#if defined( AT90_UART )
/* set baud rate */
UBRR = (unsigned char)baudrate;
/* enable UART receiver and transmmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|_BV(RXEN)|_BV(TXEN);
#elif defined (ATMEGA_USART)
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRRH = (unsigned char)(baudrate>>8);
UBRRL = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|(1<<RXEN)|(1<<TXEN);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL
UCSRC = (1<<URSEL)|(3<<UCSZ0);
#else
UCSRC = (3<<UCSZ0);
#endif
#elif defined (ATMEGA_USART0 )
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X0); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRR0H = (unsigned char)(baudrate>>8);
UBRR0L = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE0)|(1<<RXEN0)|(1<<TXEN0);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL0
UCSR0C = (1<<URSEL0)|(3<<UCSZ00);
#else
UCSR0C = (3<<UCSZ00);
#endif
#elif defined ( ATMEGA_UART )
/* set baud rate */
if ( baudrate & 0x8000 )
{
UART0_STATUS = (1<<U2X); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRRHI = (unsigned char)(baudrate>>8);
UBRR = (unsigned char) baudrate;
/* Enable UART receiver and transmitter and receive complete interrupt */
UART0_CONTROL = _BV(RXCIE)|(1<<RXEN)|(1<<TXEN);
#endif
}/* uart_init */
/*************************************************************************
Function: uart_getc()
Purpose: return byte from ringbuffer
Returns: lower byte: received byte from ringbuffer
higher byte: last receive error
**************************************************************************/
unsigned int uart_getc(void)
{
unsigned char tmptail;
unsigned char data;
if ( UART_RxHead == UART_RxTail ) {
return UART_NO_DATA; /* no data available */
}
/* calculate /store buffer index */
tmptail = (UART_RxTail + 1) & UART_RX_BUFFER_MASK;
UART_RxTail = tmptail;
/* get data from receive buffer */
data = UART_RxBuf[tmptail];
return (UART_LastRxError << 8) + data;
}/* uart_getc */
/*************************************************************************
Function: uart_putc()
Purpose: write byte to ringbuffer for transmitting via UART
Input: byte to be transmitted
Returns: none
**************************************************************************/
void uart_putc(unsigned char data)
{
unsigned char tmphead;
tmphead = (UART_TxHead + 1) & UART_TX_BUFFER_MASK;
while ( tmphead == UART_TxTail ){
;/* wait for free space in buffer */
}
UART_TxBuf[tmphead] = data;
UART_TxHead = tmphead;
/* enable UDRE interrupt */
UART0_CONTROL |= _BV(UART0_UDRIE);
}/* uart_putc */
/*************************************************************************
Function: uart_puts()
Purpose: transmit string to UART
Input: string to be transmitted
Returns: none
**************************************************************************/
void uart_puts(const char *s )
{
while (*s)
uart_putc(*s++);
}/* uart_puts */
/*************************************************************************
Function: uart_puts_p()
Purpose: transmit string from program memory to UART
Input: program memory string to be transmitted
Returns: none
**************************************************************************/
void uart_puts_p(const char *progmem_s )
{
register char c;
while ( (c = pgm_read_byte(progmem_s++)) )
uart_putc(c);
}/* uart_puts_p */
/*
* these functions are only for ATmegas with two USART
*/
#if defined( ATMEGA_USART1 )
SIGNAL(UART1_RECEIVE_INTERRUPT)
/*************************************************************************
Function: UART1 Receive Complete interrupt
Purpose: called when the UART1 has received a character
**************************************************************************/
{
unsigned char tmphead;
unsigned char data;
unsigned char usr;
unsigned char lastRxError;
/* read UART status register and UART data register */
usr = UART1_STATUS;
data = UART1_DATA;
/* */
lastRxError = (usr & (_BV(FE1)|_BV(DOR1)) );
/* calculate buffer index */
tmphead = ( UART1_RxHead + 1) & UART_RX_BUFFER_MASK;
if ( tmphead == UART1_RxTail ) {
/* error: receive buffer overflow */
lastRxError = UART_BUFFER_OVERFLOW >> 8;
}else{
/* store new index */
UART1_RxHead = tmphead;
/* store received data in buffer */
UART1_RxBuf[tmphead] = data;
}
UART1_LastRxError = lastRxError;
}
SIGNAL(UART1_TRANSMIT_INTERRUPT)
/*************************************************************************
Function: UART1 Data Register Empty interrupt
Purpose: called when the UART1 is ready to transmit the next byte
**************************************************************************/
{
unsigned char tmptail;
if ( UART1_TxHead != UART1_TxTail) {
/* calculate and store new buffer index */
tmptail = (UART1_TxTail + 1) & UART_TX_BUFFER_MASK;
UART1_TxTail = tmptail;
/* get one byte from buffer and write it to UART */
UART1_DATA = UART1_TxBuf[tmptail]; /* start transmission */
}else{
/* tx buffer empty, disable UDRE interrupt */
UART1_CONTROL &= ~_BV(UART1_UDRIE);
}
}
/*************************************************************************
Function: uart1_init()
Purpose: initialize UART1 and set baudrate
Input: baudrate using macro UART_BAUD_SELECT()
Returns: none
**************************************************************************/
void uart1_init(unsigned int baudrate)
{
UART1_TxHead = 0;
UART1_TxTail = 0;
UART1_RxHead = 0;
UART1_RxTail = 0;
/* Set baud rate */
if ( baudrate & 0x8000 )
{
UART1_STATUS = (1<<U2X1); //Enable 2x speed
baudrate &= ~0x8000;
}
UBRR1H = (unsigned char)(baudrate>>8);
UBRR1L = (unsigned char) baudrate;
/* Enable USART receiver and transmitter and receive complete interrupt */
UART1_CONTROL = _BV(RXCIE1)|(1<<RXEN1)|(1<<TXEN1);
/* Set frame format: asynchronous, 8data, no parity, 1stop bit */
#ifdef URSEL1
UCSR1C = (1<<URSEL1)|(3<<UCSZ10);
#else
UCSR1C = (3<<UCSZ10);
#endif
}/* uart_init */
/*************************************************************************
Function: uart1_getc()
Purpose: return byte from ringbuffer
Returns: lower byte: received byte from ringbuffer
higher byte: last receive error
**************************************************************************/
unsigned int uart1_getc(void)
{
unsigned char tmptail;
unsigned char data;
if ( UART1_RxHead == UART1_RxTail ) {
return UART_NO_DATA; /* no data available */
}
/* calculate /store buffer index */
tmptail = (UART1_RxTail + 1) & UART_RX_BUFFER_MASK;
UART1_RxTail = tmptail;
/* get data from receive buffer */
data = UART1_RxBuf[tmptail];
return (UART1_LastRxError << 8) + data;
}/* uart1_getc */
/*************************************************************************
Function: uart1_putc()
Purpose: write byte to ringbuffer for transmitting via UART
Input: byte to be transmitted
Returns: none
**************************************************************************/
void uart1_putc(unsigned char data)
{
unsigned char tmphead;
tmphead = (UART1_TxHead + 1) & UART_TX_BUFFER_MASK;
while ( tmphead == UART1_TxTail ){
;/* wait for free space in buffer */
}
UART1_TxBuf[tmphead] = data;
UART1_TxHead = tmphead;
/* enable UDRE interrupt */
UART1_CONTROL |= _BV(UART1_UDRIE);
}/* uart1_putc */
/*************************************************************************
Function: uart1_puts()
Purpose: transmit string to UART1
Input: string to be transmitted
Returns: none
**************************************************************************/
void uart1_puts(const char *s )
{
while (*s)
uart1_putc(*s++);
}/* uart1_puts */
/*************************************************************************
Function: uart1_puts_p()
Purpose: transmit string from program memory to UART1
Input: program memory string to be transmitted
Returns: none
**************************************************************************/
void uart1_puts_p(const char *progmem_s )
{
register char c;
while ( (c = pgm_read_byte(progmem_s++)) )
uart1_putc(c);
}/* uart1_puts_p */
#endif

View file

@ -0,0 +1,179 @@
#ifndef UART_H
#define UART_H
/************************************************************************
Title: Interrupt UART library with receive/transmit circular buffers
Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
File: $Id: uart.h,v 1.7.2.5 2005/08/14 11:25:41 Peter Exp $
Software: AVR-GCC 3.3
Hardware: any AVR with built-in UART, tested on AT90S8515 at 4 Mhz
Usage: see Doxygen manual
************************************************************************/
/**
* @defgroup pfleury_uart UART Library
* @code #include <uart.h> @endcode
*
* @brief Interrupt UART library using the built-in UART with transmit and receive circular buffers.
*
* This library can be used to transmit and receive data through the built in UART.
*
* An interrupt is generated when the UART has finished transmitting or
* receiving a byte. The interrupt handling routines use circular buffers
* for buffering received and transmitted data.
*
* The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE constants define
* the size of the circular buffers in bytes. Note that these constants must be a power of 2.
* You may need to adapt this constants to your target and your application by adding
* CDEFS += -DUART_RX_BUFFER_SIZE=nn -DUART_RX_BUFFER_SIZE=nn to your Makefile.
*
* @note Based on Atmel Application Note AVR306
* @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
*/
/**@{*/
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
#endif
/*
** constants and macros
*/
/** @brief UART Baudrate Expression
* @param xtalcpu system clock in Mhz, e.g. 4000000L for 4Mhz
* @param baudrate baudrate in bps, e.g. 1200, 2400, 9600
*/
#define UART_BAUD_SELECT(baudRate,xtalCpu) ((xtalCpu)/((baudRate)*16l)-1)
/** @brief UART Baudrate Expression for ATmega double speed mode
* @param xtalcpu system clock in Mhz, e.g. 4000000L for 4Mhz
* @param baudrate baudrate in bps, e.g. 1200, 2400, 9600
*/
#define UART_BAUD_SELECT_DOUBLE_SPEED(baudRate,xtalCpu) (((xtalCpu)/((baudRate)*8l)-1)|0x8000)
/** Size of the circular receive buffer, must be power of 2 */
#ifndef UART_RX_BUFFER_SIZE
#define UART_RX_BUFFER_SIZE 32
#endif
/** Size of the circular transmit buffer, must be power of 2 */
#ifndef UART_TX_BUFFER_SIZE
#define UART_TX_BUFFER_SIZE 32
#endif
/* test if the size of the circular buffers fits into SRAM */
#if ( (UART_RX_BUFFER_SIZE+UART_TX_BUFFER_SIZE) >= (RAMEND-0x60 ) )
#error "size of UART_RX_BUFFER_SIZE + UART_TX_BUFFER_SIZE larger than size of SRAM"
#endif
/*
** high byte error return code of uart_getc()
*/
#define UART_FRAME_ERROR 0x0800 /* Framing Error by UART */
#define UART_OVERRUN_ERROR 0x0400 /* Overrun condition by UART */
#define UART_BUFFER_OVERFLOW 0x0200 /* receive ringbuffer overflow */
#define UART_NO_DATA 0x0100 /* no receive data available */
/*
** function prototypes
*/
/**
@brief Initialize UART and set baudrate
@param baudrate Specify baudrate using macro UART_BAUD_SELECT()
@return none
*/
extern void uart_init(unsigned int baudrate);
/**
* @brief Get received byte from ringbuffer
*
* Returns in the lower byte the received character and in the
* higher byte the last receive error.
* UART_NO_DATA is returned when no data is available.
*
* @param void
* @return lower byte: received byte from ringbuffer
* @return higher byte: last receive status
* - \b 0 successfully received data from UART
* - \b UART_NO_DATA
* <br>no receive data available
* - \b UART_BUFFER_OVERFLOW
* <br>Receive ringbuffer overflow.
* We are not reading the receive buffer fast enough,
* one or more received character have been dropped
* - \b UART_OVERRUN_ERROR
* <br>Overrun condition by UART.
* A character already present in the UART UDR register was
* not read by the interrupt handler before the next character arrived,
* one or more received characters have been dropped.
* - \b UART_FRAME_ERROR
* <br>Framing Error by UART
*/
extern unsigned int uart_getc(void);
/**
* @brief Put byte to ringbuffer for transmitting via UART
* @param data byte to be transmitted
* @return none
*/
extern void uart_putc(unsigned char data);
/**
* @brief Put string to ringbuffer for transmitting via UART
*
* The string is buffered by the uart library in a circular buffer
* and one character at a time is transmitted to the UART using interrupts.
* Blocks if it can not write the whole string into the circular buffer.
*
* @param s string to be transmitted
* @return none
*/
extern void uart_puts(const char *s );
/**
* @brief Put string from program memory to ringbuffer for transmitting via UART.
*
* The string is buffered by the uart library in a circular buffer
* and one character at a time is transmitted to the UART using interrupts.
* Blocks if it can not write the whole string into the circular buffer.
*
* @param s program memory string to be transmitted
* @return none
* @see uart_puts_P
*/
extern void uart_puts_p(const char *s );
/**
* @brief Macro to automatically put a string constant into program memory
*/
#define uart_puts_P(__s) uart_puts_p(PSTR(__s))
/** @brief Initialize USART1 (only available on selected ATmegas) @see uart_init */
extern void uart1_init(unsigned int baudrate);
/** @brief Get received byte of USART1 from ringbuffer. (only available on selected ATmega) @see uart_getc */
extern unsigned int uart1_getc(void);
/** @brief Put byte to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_putc */
extern void uart1_putc(unsigned char data);
/** @brief Put string to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_puts */
extern void uart1_puts(const char *s );
/** @brief Put string from program memory to ringbuffer for transmitting via USART1 (only available on selected ATmega) @see uart_puts_p */
extern void uart1_puts_p(const char *s );
/** @brief Macro to automatically put a string constant into program memory */
#define uart1_puts_P(__s) uart1_puts_p(PSTR(__s))
/**@}*/
#endif // UART_H

View file

@ -0,0 +1,54 @@
#include "navigation.h"
// Initialisiert die Klasse
Navigation::Navigation() {
richtung = 0;
ausrichtung = 0;
geschwindigkeit = 0;
Aktualisieren();
}
Navigation::~Navigation() {
}
// Setze eine neue Richtung
void Navigation::SetzeRichtung(int nRichtung) {
richtung = nRichtung;
}
// Setze eine neue Ausrichtung
void Navigation::SetzeAusrichtung(int nAusrichtung) {
ausrichtung = nAusrichtung;
}
// Setze eine neue Geschwindigkeit
void Navigation::SetzeGeschwindigkeit(int nGeschwindigkeit) {
geschwindigkeit = nGeschwindigkeit;
}
// Aktualieren ohne Parameter
void Navigation::Aktualisieren() {
// Richtung in x und y-Kompontente zerlegen
int y = (int)cos(richtung); // richtung ist winkel
int x = (int)sin(richtung);
// Abweichung der Ausrichtung ermitteln(als winkel)
int w = sensor.getAusrichtung() - ausrichtung;
// Stärke der einzelnen Motoren berechnen
float v0 = x;
float v1 = (-x+sqrt(3)*y)/2;
float v2 = (-x-sqrt(3)*y)/2;
// Ausgerechnete Stärke an die Motoren übergeben
board.motor(0,(int)v0*geschwindigkeit +w);
board.motor(1,(int)v1*geschwindigkeit +w);
board.motor(2,(int)v2*geschwindigkeit +w);
}
// Aktualieren mit allen Parametern
void Navigation::Aktualisieren(int nRichtung,int nAusrichtung,int nGeschwindigkeit) {
SetzeRichtung(nRichtung); // Übergebene Werte schreiben
SetzeAusrichtung(nAusrichtung);
SetzeGeschwindigkeit(nGeschwindigkeit);
Aktualisieren(); // Und anwenden
}

View file

@ -0,0 +1,31 @@
#ifndef _NAVIGATION_H_
#define _NAVIGATION_H_
#include <math.h>
#include "hal/board.h"
#include "sensor/sensor.h"
extern Board board;
extern Sensor sensor;
class Navigation
{
private:
int richtung;
int ausrichtung;
int geschwindigkeit;
public:
Navigation();
~Navigation();
void SetzeRichtung(int nRichtung);
void SetzeAusrichtung(int nAusrichtung);
void SetzeGeschwindigkeit(int nGeschwindigkeit);
void Aktualisieren(int nRichtung,int nAusrichtung,int nGeschwindigkeit);
void Aktualisieren();
};
#endif

View file

@ -0,0 +1,11 @@
#include "ballsensor.h"
Ballsensor::Ballsensor() {
}
Ballsensor::~Ballsensor() {
}
int Ballsensor::getBallwinkel() {
return 0;
}

View file

@ -0,0 +1,18 @@
#ifndef _BALLSENSOR_H_
#define _BALLSENSOR_H_
#include "../hal/board.h"
extern Board board;
class Ballsensor
{
private:
public:
Ballsensor();
~Ballsensor();
int getBallwinkel(); // Gibt den aktuellen Winkel vom Ball zurück
};
#endif

View file

@ -0,0 +1,15 @@
#include "sensor.h"
Sensor::Sensor() :ballsensor() {
//ballsensor = new Ballsensor;
}
Sensor::~Sensor() {
}
void Sensor::Aktualisieren() {
}
int Sensor::getAusrichtung() {
return 0;
}

View file

@ -0,0 +1,23 @@
#ifndef _SENSOR_H_
#define _SENSOR_H_
#include "../hal/board.h"
#include "ballsensor.h"
#include "../global.h"
extern Board board;
class Sensor
{
private:
Ballsensor ballsensor;
public:
Sensor();
~Sensor();
void Aktualisieren();
int getAusrichtung(); // Gibt die aktuelle Ausrichtung des Roboters zurück
};
#endif