Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Commit 22a1ff4

Browse files
authored
Deprecate I2C reverseByteOrder function.
Throwing an error now based on deprecation from: #48
1 parent 060f6d6 commit 22a1ff4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Adafruit_GPIO/I2C.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626

2727

2828
def reverseByteOrder(data):
29-
"""Reverses the byte order of an int (16-bit) or long (32-bit) value."""
30-
# Courtesy Vishal Sapre
31-
byteCount = len(hex(data)[2:].replace('L','')[::2])
32-
val = 0
33-
for i in range(byteCount):
34-
val = (val << 8) | (data & 0xff)
35-
data >>= 8
36-
return val
29+
"""DEPRECATED: See https://github.com/adafruit/Adafruit_Python_GPIO/issues/48"""
30+
# # Courtesy Vishal Sapre
31+
# byteCount = len(hex(data)[2:].replace('L','')[::2])
32+
# val = 0
33+
# for i in range(byteCount):
34+
# val = (val << 8) | (data & 0xff)
35+
# data >>= 8
36+
# return val
37+
raise RuntimeError('reverseByteOrder is deprecated! See: https://github.com/adafruit/Adafruit_Python_GPIO/issues/48')
3738

3839
def get_default_bus():
3940
"""Return the default bus number based on the device platform. For a

0 commit comments

Comments
 (0)