From b313abd7449af357d6815e1116975d5987a39364 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 8 May 2011 15:43:13 +0200 Subject: digital/*/tools: use robot specific init parameters --- digital/mimot/tools/mimot/init.py | 17 +++++++---------- digital/mimot/tools/write_eeprom.py | 17 ++++------------- 2 files changed, 11 insertions(+), 23 deletions(-) (limited to 'digital/mimot') 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 () -- cgit v1.2.3