1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 12:53:22 +00:00

fixing issue related to loading the SPI2 overlay, forcing use of the sample provided by NTC in their chip-dt-overlays deb package.

This commit is contained in:
Robert Wolterman
2017-01-28 02:34:04 +00:00
parent bf27e2feea
commit eafcf0bf69
3 changed files with 10 additions and 18 deletions

View File

@ -24,6 +24,7 @@ import time
DEBUG = False
OVERLAYINSTALLPATH = "/lib/firmware/chip_io"
SPIINSTALLPATH = "/lib/firmware/nextthingco/chip"
OVERLAYCONFIGPATH = "/sys/kernel/config/device-tree/overlays"
CUSTOMOVERLAYFILEPATH = ""
@ -41,7 +42,7 @@ _LOADED = {
}
_OVERLAYS = {
"SPI2" : "chip-spi2.dtbo",
"SPI2" : "sample-spi.dtbo",
"PWM0" : "chip-pwm0.dtbo",
"CUST" : ""
}
@ -160,7 +161,11 @@ def load(overlay, path=""):
# SET UP THE OVERLAY PATH FOR OUR USE
if overlay.upper() != "CUST":
opath = OVERLAYINSTALLPATH + "/" + _OVERLAYS[overlay.upper()]
opath = OVERLAYINSTALLPATH
# IF THE OVERLAY IS SPI, USE THE NTC PATH
if overlay.upper() == "SPI2":
opath = SPIINSTALLPATH
opath += "/" + _OVERLAYS[overlay.upper()]
else:
opath = path
if DEBUG: