summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-28 15:31:57 +0200
committerNicolas Schodet2008-04-28 15:31:57 +0200
commit075cf88f93c34e26dc7e543a8b746c705a907ee0 (patch)
tree7d04b94de34c1b407dfecee32a2e2b81bbecabb1
parent9db8edadcb71c67526fb34cd5c11a174608e875b (diff)
* digital/asserv/tools:
- added tools to write eeprom.
-rw-r--r--digital/asserv/tools/asserv.py4
-rw-r--r--digital/asserv/tools/write_eeprom.py17
2 files changed, 21 insertions, 0 deletions
diff --git a/digital/asserv/tools/asserv.py b/digital/asserv/tools/asserv.py
index 277e4064..8f2c65b7 100644
--- a/digital/asserv/tools/asserv.py
+++ b/digital/asserv/tools/asserv.py
@@ -199,6 +199,10 @@ class Asserv:
self.proto.send ('p', 'BL', ord ('c'), p['c'] * 256 * 256 * 256)
self.proto.send ('p', 'BH', ord ('f'), p['f'])
+ def write_eeprom (self):
+ self.proto.send ('p', 'BB', ord ('E'), 1)
+ self.wait (lambda: True)
+
def handle_stats (self, stat, *args):
if self.stats_enabled is not None:
self.stats_line.extend (args)
diff --git a/digital/asserv/tools/write_eeprom.py b/digital/asserv/tools/write_eeprom.py
new file mode 100644
index 00000000..6b7272c3
--- /dev/null
+++ b/digital/asserv/tools/write_eeprom.py
@@ -0,0 +1,17 @@
+import sys
+sys.path.append (sys.path[0] + '/../../../host/proto')
+
+from asserv import Asserv
+import init
+import popen_io
+import serial
+
+if sys.argv[1] == '!':
+ io = popen_io.PopenIO (sys.argv[2:])
+ init = init.host
+else:
+ io = serial.Serial (sys.argv[1])
+ init = init.target
+a = Asserv (io, **init)
+a.write_eeprom ()
+a.close ()