From 075cf88f93c34e26dc7e543a8b746c705a907ee0 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 28 Apr 2008 15:31:57 +0200 Subject: * digital/asserv/tools: - added tools to write eeprom. --- digital/asserv/tools/asserv.py | 4 ++++ digital/asserv/tools/write_eeprom.py | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 digital/asserv/tools/write_eeprom.py 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 () -- cgit v1.2.3