Skip to content

adafruit_si4713: prefer 'struct', falling back to 'ustruct' #3

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

Merged
merged 1 commit into from
May 3, 2018
Merged
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
7 changes: 5 additions & 2 deletions adafruit_si4713.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
import time

from micropython import const
import ustruct
try:
import struct
except ImportError:
import ustruct as struct

import adafruit_bus_device.i2c_device as i2c_device

Expand Down Expand Up @@ -379,7 +382,7 @@ def input_level(self):
"""
# Perform ASQ request, then parse out 8 bit _signed_ input level value.
self._asq_status()
return ustruct.unpack('bbbbb', self._BUFFER)[4]
return struct.unpack('bbbbb', self._BUFFER)[4]

@property
def audio_signal_status(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = ["micropython", "ustruct", "adafruit_bus_device", "adafruit_bus_device.i2c_device"]
autodoc_mock_imports = ["micropython", "adafruit_bus_device", "adafruit_bus_device.i2c_device"]

intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/bus_device/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

Expand Down