From 63a0f3b710ebd6651a159aef16f2195396290aa9 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Mon, 31 Mar 2008 18:43:51 +0200 Subject: * digital/avr/modules/twi: - added host support. --- digital/avr/modules/twi/test/test_twi_host.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 digital/avr/modules/twi/test/test_twi_host.py (limited to 'digital/avr/modules/twi/test/test_twi_host.py') diff --git a/digital/avr/modules/twi/test/test_twi_host.py b/digital/avr/modules/twi/test/test_twi_host.py new file mode 100644 index 00000000..67942276 --- /dev/null +++ b/digital/avr/modules/twi/test/test_twi_host.py @@ -0,0 +1,32 @@ +import sys +sys.path.append (sys.path[0] + '/../../../../../host/mex') + +from mex.hub import Hub +from mex.msg import Msg +from mex.node import Node +from mex.forked import Forked + +import os, signal, time + +def log (x): + print x + +h = Hub (min_clients = 3, log = log) +fh = Forked (h.wait) + +n = Node () +def nf (): + while True: + time.sleep (1) + n.wait (n.date + 1) +fn = Forked (nf) + +slave = os.popen ('./test_twi_sl.host', 'w') + +try: + os.system ('./test_twi_master.host') +finally: + fn.kill () + fh.kill () + slave.close () + time.sleep (1) -- cgit v1.2.3