aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-05-03 14:47:38 +0800
committerTat-Chee Wan (USM)2011-05-03 14:47:38 +0800
commit166fe4fbb3de88850d327e829b1a768d99ab26cc (patch)
tree34bf5df14a26746224c5cc045d1944709666e9bb /AT91SAM7S256/armdebug
parentefa35bbf85ba1bfa37b34bc35d4fa5e8cf3208f6 (diff)
parent1e3b294f345511538c64cce8f9f3e0ba3c82d1e3 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug')
-rw-r--r--AT91SAM7S256/armdebug/nxt-python-fantom/nxt/bluesock.py6
-rw-r--r--AT91SAM7S256/armdebug/nxt-python-fantom/nxt/fantomglue.py9
-rw-r--r--AT91SAM7S256/armdebug/nxt-python-fantom/nxt/sensor/hitechnic.py2
-rw-r--r--AT91SAM7S256/armdebug/nxt-python-fantom/nxt/usbsock.py6
-rwxr-xr-xAT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-nxt_test3
-rwxr-xr-xAT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-syspython3
6 files changed, 17 insertions, 12 deletions
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/bluesock.py b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/bluesock.py
index b4a2739..99917f2 100644
--- a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/bluesock.py
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/bluesock.py
@@ -13,12 +13,12 @@
# GNU General Public License for more details.
try:
- import bluetooth
+ import fantomglue as bluetooth
except ImportError:
try:
- import lightblueglue as bluetooth
+ import bluetooth
except ImportError:
- import pyfantom as bluetooth
+ import lightblueglue as bluetooth
import os
from .brick import Brick
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/fantomglue.py b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/fantomglue.py
index 5e85e03..6281c95 100644
--- a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/fantomglue.py
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/fantomglue.py
@@ -23,7 +23,7 @@ FANTOM_USB = 0
# Bluetooth Iterator
def discover_devices(lookup_names=False): # parameter is ignored
pairs = []
- for d in NXTIterator(True):
+ for d in pyfantom.NXTIterator(True):
# h: host, n: name
h = d.get_resource_string()
nxt = d.get_nxt()
@@ -44,7 +44,7 @@ class BluetoothSocket:
addr, port = addrport
if self._sock is None:
# Port is ignored
- self._sock = NXT(addr)
+ self._sock = pyfantom.NXT(addr)
def send(self, data):
return self._sock.write( data )
@@ -64,7 +64,7 @@ def _check_brick(arg, value):
def find_devices(lookup_names=False): # parameter is ignored
devicelist = []
- for d in NXTIterator(False):
+ for d in pyfantom.NXTIterator(False):
nxt = d.get_nxt()
devicelist.append(nxt)
return devicelist
@@ -96,10 +96,9 @@ class USBSocket:
return devinfo.name
def connect(self):
- addr, port = addrport
if self._sock is None:
# Port is ignored
- self._sock = NXT(addr)
+ self._sock = pyfantom.NXT(addr)
def send(self, data):
return self._sock.write( data )
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/sensor/hitechnic.py b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/sensor/hitechnic.py
index d2bd8ec..3c152d3 100644
--- a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/sensor/hitechnic.py
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/sensor/hitechnic.py
@@ -247,7 +247,7 @@ class EOPD(BaseAnalogSensor):
def __init__(self, brick, port):
super(EOPD, self).__init__(brick, port)
- from math import sqrt
+ from math import sqrt
self.sqrt = sqrt
def set_range_long(self):
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/usbsock.py b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/usbsock.py
index 78c21ab..9df7792 100644
--- a/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/usbsock.py
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/nxt/usbsock.py
@@ -13,9 +13,9 @@
# GNU General Public License for more details.
try:
- import pyusbglue as usb
+ import fantomglue as usb
except ImportError:
- import pyfantom as usb
+ import pyusbglue as usb
from nxt.brick import Brick
@@ -25,7 +25,7 @@ class USBSock(object):
bsize = 60 # USB socket block size
def __init__(self, device):
- self.sock = USBSocket(device)
+ self.sock = usb.USBSocket(device)
self.debug = False
def __str__(self):
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-nxt_test b/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-nxt_test
new file mode 100755
index 0000000..c78061c
--- /dev/null
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-nxt_test
@@ -0,0 +1,3 @@
+#!/bin/sh
+export PYTHONPATH=~/gitrepo/armdebug/nxt-python-fantom
+arch -i386 /usr/bin/python2.6 ~/gitrepo/armdebug/nxt-python-fantom/scripts/nxt_test
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-syspython b/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-syspython
new file mode 100755
index 0000000..cea6c52
--- /dev/null
+++ b/AT91SAM7S256/armdebug/nxt-python-fantom/scripts/pyenv-syspython
@@ -0,0 +1,3 @@
+#!/bin/sh
+export PYTHONPATH=~/gitrepo/armdebug/nxt-python-fantom
+arch -i386 /usr/bin/python2.6