summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2011-06-05 01:14:49 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2011-06-05 01:14:49 (GMT)
commite349242c5b5c19da346917d039dab44ef92d5a4f (patch)
treeb9cc4733571e07f5e13eaf72fb150851d6c472d8
parent2bf7f68f23b5a6d97f48e2729ca55ff2ca4921f9 (diff)
downloadde1flash-e349242c5b5c19da346917d039dab44ef92d5a4f.zip
de1flash-e349242c5b5c19da346917d039dab44ef92d5a4f.tar.gz
de1flash-e349242c5b5c19da346917d039dab44ef92d5a4f.tar.bz2
de1flash-e349242c5b5c19da346917d039dab44ef92d5a4f.tar.xz
Fix the erase wait logic
-rw-r--r--de1flash.tcl7
1 files changed, 4 insertions, 3 deletions
diff --git a/de1flash.tcl b/de1flash.tcl
index b6c8c6b..ef7e062 100644
--- a/de1flash.tcl
+++ b/de1flash.tcl
@@ -159,10 +159,11 @@ proc fl_erase addr {
set read_cmd [format "D0%08X%08X" $secaddr 8]
- set ndone 1
- while { $ndone } {
+ set done 0
+ while { !$done } {
fl_send $read_cmd
- set ndone [string match [fl_recv] "\[89ABCDEF\]DFFFFFFFFFFFFFFFF"]
+ set v [fl_recv]
+ set done [string match {[89ABCDEF]DFFFFFFFFFFFFFFFF} $v]
}
puts "done."
} else {