chiark
/
gitweb
/
~ijackson
/
trains.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7344a0
)
hostside/measure-speeds: better recovery from unhelpful initial positions
author
Ian Jackson
<ian@davenant.greenend.org.uk>
Mon, 3 Jan 2011 18:29:05 +0000
(18:29 +0000)
committer
Ian Jackson
<ian@davenant.greenend.org.uk>
Mon, 3 Jan 2011 18:29:05 +0000
(18:29 +0000)
hostside/measure-speeds
patch
|
blob
|
history
diff --git
a/hostside/measure-speeds
b/hostside/measure-speeds
index 3b8f20e4c53b1e69dac537c7e5851927344d598d..70844e76899f34e0f837c32d996505ec8f3c8ca5 100755
(executable)
--- a/
hostside/measure-speeds
+++ b/
hostside/measure-speeds
@@
-39,7
+39,7
@@
proc startup {} {
read -nonewline $rwy
fileevent $rwy readable readable
set buf {}
- set last_fast_speed
0
+ set last_fast_speed
-1
set noise {}
for {set i 0} {$i < 256} {incr i} { append noise \\x [hbytes random 1] }
# foreach f {funcs0to4 funcs5to8} {
@@
-240,6
+240,8
@@
proc goto-slow-start-position {speed} {
if {$last_fast_speed >= 0} {
run-until -100 [list $segs(X5) $segs(X6)]
set last_fast_speed -1
+ } else {
+ run-until 100 [list $segs(X5) $segs(X6)]
}
run-until -40 [list $segs(X7) $segs(X5)]
run-until-not -40 $segs(X5) 600