summaryrefslogtreecommitdiff
path: root/digital/mimot/tools
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-08 15:43:13 +0200
committerNicolas Schodet2011-05-08 15:44:08 +0200
commitb313abd7449af357d6815e1116975d5987a39364 (patch)
tree32c936f6bb7d49e217067d356f927dfeba8a3cbd /digital/mimot/tools
parentfd2feb1325a6899fa20fd9996e22d22205c01f85 (diff)
digital/*/tools: use robot specific init parameters
Diffstat (limited to 'digital/mimot/tools')
-rw-r--r--digital/mimot/tools/mimot/init.py17
-rw-r--r--digital/mimot/tools/write_eeprom.py17
2 files changed, 11 insertions, 23 deletions
diff --git a/digital/mimot/tools/mimot/init.py b/digital/mimot/tools/mimot/init.py
index 116cebb5..682b29cb 100644
--- a/digital/mimot/tools/mimot/init.py
+++ b/digital/mimot/tools/mimot/init.py
@@ -1,14 +1,5 @@
"""Default parameters for asserv."""
-host = dict (
- a0kp = 4,
- a0a = 16, a0sm = 0x60, a0ss = 0x10,
- a0be = 256, a0bs = 0x18, a0bc = 5,
- a1kp = 4,
- a1a = 16, a1sm = 0x60, a1ss = 0x10,
- a1be = 256, a1bs = 0x18, a1bc = 5,
- E = 0x3ff, D = 0x1ff,
- )
-target = dict (
+target_marcel = dict (
a0kp = 4,
a0a = 16, a0sm = 0x60, a0ss = 0x10,
a0be = 256, a0bs = 0x18, a0bc = 5,
@@ -18,3 +9,9 @@ target = dict (
E = 0x3ff, D = 0x1ff,
w = 0x03,
)
+target = {
+ 'marcel': target_marcel,
+ 'robospierre': target_marcel,
+ }
+
+host = target
diff --git a/digital/mimot/tools/write_eeprom.py b/digital/mimot/tools/write_eeprom.py
index ab2ae315..7fe54342 100644
--- a/digital/mimot/tools/write_eeprom.py
+++ b/digital/mimot/tools/write_eeprom.py
@@ -1,16 +1,7 @@
-import sys
-
import mimot
import mimot.init
-import proto.popen_io
-import serial
+from utils.init_proto import init_proto
-if sys.argv[1] == '!':
- io = proto.popen_io.PopenIO (sys.argv[2:])
- init = mimot.init.host
-else:
- io = serial.Serial (sys.argv[1])
- init = mimot.init.target
-a = mimot.Proto (io, **init)
-a.write_eeprom ()
-a.close ()
+m = init_proto (None, mimot.Proto, mimot.init)
+m.write_eeprom ()
+m.close ()