heise online · c't · iX · Technology Review · Telepolis · mobil · Security · Netze · Open Source · Resale · Foto · Autos · c't-TV · Jobs · Kiosk
Zum Inhalt
c't

c't Projekte - c't-Bot und c't-Sim - Mailinglisten

c't-Bot und c't-Sim


[Voriger (Datum)] [Nächster (Datum)] [Voriger (Thread)] [Nächster (Thread)]
[Nach Datum][Nach Thread]

Re: [ct-bot] Ticket 167

Absender: Achim Pankalla
Datum: Mo, 09.06.2008 10:31:01
In-reply-to: <4845800B.1090905@xxxxxx>
References: <4842DB09.5000809@xxxxxx> <F7F3EE9D-548E-4A57-B7BE-A75E393D6576@xxxxxxxxxxxxxxx> <48440C0A.4030502@xxxxxx> <C1BEF9B0-F554-4886-AB4F-CFE965C9760A@xxxxxxxxxxxxxxx> <4845516E.1080700@xxxxxx> <B96A3097-B5FE-4347-AD0A-44954325649D@xxxxxxxxxxxxxxx> <4845800B.1090905@xxxxxx>


hallo,
anbei eine überarbeitete version meine patches bezüglich ticket 167. der
angesprochene fehler wurden korregiert

Mit freundlichen Grüßen

achim
Index: E:/eclipse/ct-bot orginal/ct-Bot/pc/cmd-tools_pc.c
===================================================================
--- E:/eclipse/ct-bot orginal/ct-Bot/pc/cmd-tools_pc.c	(revision 1442)
+++ E:/eclipse/ct-bot orginal/ct-Bot/pc/cmd-tools_pc.c	(working copy)
@@ -37,6 +37,9 @@
 #include "tcp.h"
 #include "command.h"
 
+uint8_t opt_eeprom = 0;
+int opt_bot_address = -1;
+
 /*!
  * Zeigt Informationen zu den moeglichen Kommandozeilenargumenten an.
  */
@@ -109,12 +112,11 @@
 		
 		case 'a': {
 			/* Bot-Adresse wurde uebergeben */
-			int addr = atoi(optarg);
-			if ((addr >= CMD_SIM_ADDR) && (addr != CMD_BROADCAST)) {
+			opt_bot_address = atoi(optarg);
+			if ((opt_bot_address >= CMD_SIM_ADDR) && (opt_bot_address != CMD_BROADCAST)) {
 				printf("Unzulaessige Bot-Adresse!\n");
 				exit(1);
 			}
-			set_bot_address(addr);
 			break;
 		}
 		
@@ -224,12 +226,7 @@
 		case 'i': {
 			/* EEPROM-Init */
 			printf("EEPROM soll mit den Daten einer eep-Datei initialisiert werden.\n");
-			if (init_eeprom_man(1) != 0) {
-				printf("Fehler bei EEPROM-Initialisierung!\n");
-			} else {
-				printf("done.\n");
-			}
-			exit(0);
+			opt_eeprom = 1;
 		}
 		
 		case 'h':
Index: E:/eclipse/ct-bot orginal/ct-Bot/Changelog.txt
===================================================================
--- E:/eclipse/ct-bot orginal/ct-Bot/Changelog.txt	(revision 1442)
+++ E:/eclipse/ct-bot orginal/ct-Bot/Changelog.txt	(working copy)
@@ -1,5 +1,8 @@
 CHANGELOG fuer c't-Bot
 ======================
+2008-06-09 Achim Pankalla [achim.pankalla@xxxxxx]: 	EEPROM Emulation (#167), Benutzung von EEPROM Variablen vor der Initialisierung des EEPROM-Emulators. 
+													Emulation geht nun wieder mit bot-adressierung.
+													
 2008-05-21 Timo Sandmann [mail@xxxxxxxxxxxxxxx]: TCP-Testserver / -Client debuggt (#161), funktioniert nun (wieder)
 
 2008-05-19 Timo Sandmann [mail@xxxxxxxxxxxxxxx]: 3. Version fuer catch_pillar(), aehnlich zu Version 2, berechnet die Entfernung zum Objekt aber anders. Einstellbar mit #define CATCH_PILLAR_VERSION in behaviour_catch_pillar.c
Index: E:/eclipse/ct-bot orginal/ct-Bot/ct-Bot.c
===================================================================
--- E:/eclipse/ct-bot orginal/ct-Bot/ct-Bot.c	(revision 1442)
+++ E:/eclipse/ct-bot orginal/ct-Bot/ct-Bot.c	(working copy)
@@ -44,6 +44,9 @@
 	#include <stdio.h>
 	#include <time.h>
 	#include <sys/time.h>
+
+extern uint8_t opt_eeprom;
+extern int opt_bot_address;
 #endif
 
 #include "global.h"
@@ -125,11 +128,6 @@
 	#ifdef BOT_2_PC_AVAILABLE
 		bot_2_pc_init();
 	#endif
-	#ifdef PC
-		if (init_eeprom_man(0) != 0) {
-			LOG_ERROR("EEPROM-Manager nicht korrekt initialisiert!");
-		}
-	#endif
 	#ifdef DISPLAY_AVAILABLE
 		display_init();
 	#endif
@@ -188,6 +186,13 @@
 	/* Kommandozeilen-Argumente auswerten */
 	hand_cmd_args(argc, argv);
 	
+	if (init_eeprom_man(opt_eeprom) != 0) {
+		LOG_ERROR("EEPROM-Manager nicht korrekt initialisiert!");
+	}
+
+	if(opt_bot_address != -1)
+		set_bot_address((uint8_t)opt_bot_address);
+	
 	printf("c't-Bot\n");
 	
 	/* Bot-2-Sim-Kommunikation initialisieren */