|
c't Projekte - c't-Bot und c't-Sim -
Mailinglisten
[Voriger (Datum)]
[Nächster (Datum)]
[Voriger (Thread)]
[Nächster (Thread)]
[Nach Datum][Nach Thread]
Absender: Frank Menzel
Datum: Mo, 15.09.2008 21:51:38
In-reply-to:
<3EB3C6EA-6F48-4108-AB06-8621E12EA5D7@xxxxxxxxxxxxxxx>
Hallo Timo,
Start ist bei 282 und Ende bei 2280.
Den Patch habe ich eingespielt (Zeilen manuell eingefügt da direkt in
der Mail drin) und muss sagen: Es klappt prima !
MMC-Test prima, der ja vorher aber auch schon lief mit denselben
Kartendaten. Aber das Map_Delete läuft jetzt wunderbar durch und die
Karte ist in 40 Sekunden gelöscht. Jedenfalls bricht er nicht kurz nach
dem Start ab. Ist die Löschzeit annähernd richtig ? Scheint mir doch
recht lange zu sein.
Ansonsten besten Dank !
Gruß, Frank
-----Ursprüngliche Nachricht-----
Von: ct-bot-entwickler-bounces@xxxxxxxxxxxxxxxxx
[mailto:ct-bot-entwickler-bounces@xxxxxxxxxxxxxxxxx] Im Auftrag von Timo
Sandmann
Gesendet: Montag, 15. September 2008 20:22
An: Entwicklung rund um den c't-bot
Betreff: Re: [ct-bot] SPI-Hardwareumbau
Hallo Frank,
Am 15.09.2008 um 16:43 schrieb Frank Menzel:
> Hallo Timo,
> er gibt jetzt aus: Fehler 3 an der Stelle 37f. bei Map_delete selbst
> zeigt er diesen eine Adresse weiter an bei 380.
was ist denn die Anfangsadresse der Map-Datei? Nur interessehalber.
> Tja, also Fehler 3, was wohl das Ergebnis von mmc_write_sector ist.
> Aber
> woran liegt's ?
Probiere bitte mal den angehängten Patch aus. Am besten zuerst den MMC-
Test und dann das Löschen der Map. Ich habe das jetzt nicht großartig
getestet, daher erstmal nur als Patch.
Grüße,
Timo
### Eclipse Workspace Patch 1.0
#P ct-Bot-svn
Index: mcu/mmc.c
===================================================================
--- mcu/mmc.c (revision 1483)
+++ mcu/mmc.c (working copy)
@@ -403,30 +403,36 @@
#ifdef MMC_AGGRESSIVE_OPTIMIZATION
#if 1
uint16_t timeout;
+ uint8_t timeout_high;
SPDR = 0xff;
asm volatile(
"ldi %A0,lo8(-1) ; timeout \n\t"
- "ldi %B0,hi8(-1) ; timeout \n\t"
+ "ldi %B0,hi8(-1) ; = \n\t"
+ "mov %1,%A0 ; 0xffffff \n\t"
"1:
\n\t"
- "sbiw %0,1 ; timeout-- \n\t"
+// "sbiw %0,1 ; timeout-- \n\t"
+ "subi %A0,1 ; timeout-- \n\t"
+ "sbci %B0,0
\n\t"
+ "sbc %1,__zero_reg__ \n\t"
"breq 2f
\n\t"
- "adiw %0,1 ; 2 nop \n\t"
- "sbiw %0,1 ; 2 nop \n\t"
- "adiw %0,1 ; 2 nop \n\t"
- "sbiw %0,1 ; 2 nop \n\t"
- "nop ; 1 nop \n\t"
+ "adiw r28,1 ; 2 nop \n\t"
+ "sbiw r28,1 ; 2 nop \n\t"
+ "adiw r28,1 ; 2 nop \n\t"
+ "sbiw r28,1 ; 2 nop \n\t"
+// "nop ; 1 nop \n\t"
"ldi r25,lo8(-1) ; 1 nop \n\t"
- "in r24,%1 ;
\n\t"
- "out %1,r25 ;
\n\t"
+ "in r24,%2 ;
\n\t"
+ "out %2,r25 ;
\n\t"
"cpi r24,lo8(-1) ; == 0xff? \n\t"
"brne 1b
\n\t"
"2:
"
- : "=&y" (timeout)
+ : "=&d" (timeout), "=&r" (timeout_high)
: "M" (_SFR_IO_ADDR(SPDR))
: "r24", "r25"
);
#else
uint16_t timeout = 0xffff;
+ uint8_t timeout_high = 0;
/* warten, bis Karte mit "0xff" antwortet */
uint8_t response = 0;
SPDR = 0xff;
@@ -449,7 +455,7 @@
#endif // LED_AVAILABLE
os_exitCS();
- if (timeout == 0) {
+ if (timeout == 0 && timeout_high == 0) {
mmc_init_state = 1;
return 3;
}
_______________________________________________
ct-bot-entwickler Mailingliste
ct-bot-entwickler@xxxxxxxxxxxxxxxxx
http://www.heise.de/bin/newsletter/listinfo/ct-bot-entwickler
|
|