Skip to content

Commit

Permalink
Adjust syscall no. for 32bit platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
0xc0decafe authored Oct 15, 2023
1 parent c65d97c commit 1cb93af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions smbus2/smbus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import os
import sys
from platform import system
from platform import system, architecture
from fcntl import ioctl
from ctypes import c_uint32, c_uint8, c_uint16, c_char, POINTER, Structure, Array, Union, create_string_buffer, string_at

Expand Down Expand Up @@ -51,7 +51,8 @@
I2C_SMBUS_BLOCK_MAX = 32

#FreeBSD RDWR syscall
I2CRDWR = 0x80106906
(bits, _) = architecture()
I2CRDWR = { '64bit': 0x80106906, '32bit': 0x80086906 }[bits]

# To determine what functionality is present (uapi/linux/i2c.h)
try:
Expand Down

0 comments on commit 1cb93af

Please sign in to comment.