diff --git a/adafruit_si4713.py b/adafruit_si4713.py index 8130680..6514753 100644 --- a/adafruit_si4713.py +++ b/adafruit_si4713.py @@ -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 @@ -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): diff --git a/docs/conf.py b/docs/conf.py index 013ccb4..6b3e60e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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)}