diff --git a/config.py.EXAMPLE b/config.py.EXAMPLE index 19e9b0f..f002627 100644 --- a/config.py.EXAMPLE +++ b/config.py.EXAMPLE @@ -41,7 +41,7 @@ gpio_door = 18 # max6675 - bitbang SPI interface max31855 = 1 max6675 = 0 -max31855spi = 0 +max31855spi = 0 # if you use this one, you MUST reassign the default GPIO pins ### Thermocouple Connection (using bitbang interfaces) gpio_sensor_cs = 27 diff --git a/lib/oven.py b/lib/oven.py index 23e4582..fadd42d 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -20,6 +20,15 @@ try: import Adafruit_GPIO.SPI as SPI from max31855spi import MAX31855SPI, MAX31855SPIError log.info("import MAX31855SPI") + spi_reserved_gpio = [7, 8, 9, 10, 11] + if config.gpio_air in spi_reserved_gpio: + raise Exception("gpio_air pin %s collides with SPI pins %s" % (config.gpio_air, spi_reserved_gpio)) + if config.gpio_cool in spi_reserved_gpio: + raise Exception("gpio_cool pin %s collides with SPI pins %s" % (config.gpio_cool, spi_reserved_gpio)) + if config.gpio_door in spi_reserved_gpio: + raise Exception("gpio_door pin %s collides with SPI pins %s" % (config.gpio_door, spi_reserved_gpio)) + if config.gpio_heat in spi_reserved_gpio: + raise Exception("gpio_heat pin %s collides with SPI pins %s" % (config.gpio_heat, spi_reserved_gpio)) if config.max6675: from max6675 import MAX6675, MAX6675Error log.info("import MAX6675")