Oops, build DigitalPort.write_mask with |= instead of &=.
authorW. Trevor King <wking@drexel.edu>
Fri, 16 Mar 2012 03:41:28 +0000 (23:41 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 16 Mar 2012 03:41:28 +0000 (23:41 -0400)
If you start with 0, &= will never change anything :p.

pyafm/digital_port.py

index 0abe5c11e5dae8e5401b63060ea5b7619f95783d..4c8a401b55656072cba88880dcf8a036a37483ce 100644 (file)
@@ -43,7 +43,7 @@ class DigitalPort (object):
                 channel = self.subdevice.channel(
                     index=index, factory=_DigitalChannel)
                 channel.dio_config(c['direction'])
-                self.write_mask &= 1 << index
+                self.write_mask |= 1 << index
                 self.channels.append(channel)
         self.name = c['name']