Skip to content
Open
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
4 changes: 2 additions & 2 deletions quick2wire/spi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from ctypes import addressof, create_string_buffer, sizeof, string_at
from ctypes import addressof, create_string_buffer, sizeof, string_at, c_int32, c_uint32
import struct
import posix
from fcntl import ioctl
Expand Down Expand Up @@ -61,7 +61,7 @@ def transaction(self, *transfers):
for i, transfer in enumerate(transfers):
ioctl_arg[i] = transfers[i].to_spi_ioc_transfer()

ioctl(self.fd, SPI_IOC_MESSAGE(transfer_count), addressof(ioctl_arg))
ioctl(self.fd, SPI_IOC_MESSAGE(transfer_count), c_int32(c_uint32(addressof(ioctl_arg)).value).value)

return [transfer.to_read_bytes() for t in transfers if t.has_read_buf]

Expand Down