Change SPI bus number for Dev Board
Pre-Day, the Dev Board bus number for spidev was 32766. It is now
correctly 0.
Change-Id: I1b4507b5456e62efdd37148f4e2ad06f8df5504c
diff --git a/python/coral-enviro/coral/enviro/board.py b/python/coral-enviro/coral/enviro/board.py
index 7f73245..e964238 100644
--- a/python/coral-enviro/coral/enviro/board.py
+++ b/python/coral-enviro/coral/enviro/board.py
@@ -60,10 +60,13 @@
self._opt3002 = _get_path('opt3001')
self._tla2021 = _get_path('ads1015')
# Create SSD1306 OLED instance, with SPI as the interface.
- if 'mendel' in platform.platform():
+ plat = platform.platform()
+ if 'mendel' in plat:
from .rpi_gpio_periphery import pGPIO
# Values for the Coral Dev Board (running Mendel Linux).
- self._display = ssd1306(serial_interface=spi(gpio=pGPIO(), port=32766, device=0, gpio_DC=138, gpio_RST=140),
+ # If running legacy kernel (4.9.51), use port 32766.
+ port = 32766 if 'Linux-4.9.51-imx' in plat else 0
+ self._display = ssd1306(serial_interface=spi(gpio=pGPIO(), port=port, device=0, gpio_DC=138, gpio_RST=140),
gpio=pGPIO(), height=32, rotate=2)
else:
# Default to RPi.GPIO in luma and defaults GPIO.
diff --git a/python/coral-enviro/debian/changelog b/python/coral-enviro/debian/changelog
index 380a8b7..965dc36 100644
--- a/python/coral-enviro/debian/changelog
+++ b/python/coral-enviro/debian/changelog
@@ -1,3 +1,9 @@
+coral-enviro (1.1) stable; urgency=low
+
+ * Update Mendel SPI bus number match latest kernel.
+
+ -- Coral <coral-support@google.com> Wed, 04 Dec 2019 14:35:10 -0700
+
coral-enviro (1.0) stable; urgency=low
* Initial release.