Fixup changes
authorDan White <dan@whiteaudio.com>
Tue, 16 Oct 2012 05:50:36 +0000 (00:50 -0500)
committerDan White <dan@whiteaudio.com>
Tue, 16 Oct 2012 05:50:36 +0000 (00:50 -0500)
python-lib/usbio.py

index 18b736579b9786ac8fd98ebbe78f9900b4f0e648..b16958be3e8486816fa271b384f0e16b4438e146 100644 (file)
@@ -812,10 +812,6 @@ class MuxOTA(OTA):
     def __init__(self, mode=0, fast=0, gain=0, offset=0):
         # setup main functionality
         super(MuxOTA, self).__init__(fast=fast, gain=gain, offset=offset)
-        # remove references to re-defined bits, they are named ".mode" now
-        del self.__dict__['cint']
-        del self.__dict__['zero']
-        del self.__dict__['se']
         self.mode = mode
 
     @property
@@ -1224,10 +1220,10 @@ class AD524x(object):
         """Return a dict of settings which can be passed to constructor to
         restore the state."""
         s = {}
-        s['posA'] = self.posA
-        s['posB'] = self.posB
-        s['gpo1'] = self.gpo1
-        s['gpo2'] = self.gpo2
+        s['posA'] = int(self.posA)
+        s['posB'] = int(self.posB)
+        s['gpo1'] = int(self.gpo1)
+        s['gpo2'] = int(self.gpo2)
         return s
 
 class DAC8568(object):
@@ -1898,14 +1894,13 @@ class DAC_atoi(DAC8568):
 
         # put into official operating mode
         #
-        dac.swreset()
+        self.swreset()
         # reference is tied to ADC, do not power down
-        dac.reference(dac.REF_FLEXIBLE_ALWAYS_ON)
+        self.reference(self.REF_FLEXIBLE_ALWAYS_ON)
         # CLR is tied high, explicitly ignore anyway
-        dac.CCR(dac.IGNORE_CLR)
+        self.CCR(self.IGNORE_CLR)
         # power up all channels
-        bitfield = 0xff
-        dac.power(dac.POWER_ON, bitfield)
+        self.power(self.POWER_ON, 0xff)
         # set outputs if we are restoring state
         for name, value in (
                 ('vina', vina),
@@ -1919,7 +1914,7 @@ class DAC_atoi(DAC8568):
         # zero unused outputs
         # part A already POR's to 0 but...
         for i in range(5, 8):
-            dac.setv(i, 0.0)
+            self.setv(i, 0.0)
 
 
     def _pos2v(self, pos):