Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed AttributeError: 'PiFaceDigital' object has no attribute 'close' #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions WebIOPi-0.7.1/python/webiopi/devices/shield/piface.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def checkChannel(self, channel):
if not channel in range(8):
raise ValueError("Channel %d invalid" % channel)

def close(self):
None

@request("GET", "digital/input/%(channel)d")
@response("%d")
def digitalRead(self, channel):
Expand Down
5 changes: 3 additions & 2 deletions WebIOPi-0.7.1/python/webiopi/devices/spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _IOW(t, number, size):
SPI_MODE_3 = (SPI_CPOL|SPI_CPHA)

# does not work
# SPI_CS_HIGH = 0x04
SPI_CS_HIGH = 0x04
# SPI_LSB_FIRST = 0x08
# SPI_3WIRE = 0x10
# SPI_LOOP = 0x20
Expand Down Expand Up @@ -95,7 +95,8 @@ def __init__(self, chip=0, mode=0, bits=8, speed=0):
if fcntl.ioctl(self.fd, SPI_IOC_RD_MODE, val8):
raise Exception("Cannot read SPI Mode")
self.mode = struct.unpack('B', val8)[0]
assert(self.mode == mode)
self.mode &= ~SPI_CS_HIGH
assert(self.mode == mode)

val8[0] = bits
if fcntl.ioctl(self.fd, SPI_IOC_WR_BITS_PER_WORD, val8):
Expand Down