From 70971147812149fd7fe687c9108fa147dff0f522 Mon Sep 17 00:00:00 2001 From: txoof Date: Wed, 30 Oct 2019 21:24:17 +0100 Subject: [PATCH] fix issue #36 https://github.com/waveshare/e-Paper/issues/36 --- .../python/lib/waveshare_epd/epdconfig.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RaspberryPi_and_JetsonNano/python/lib/waveshare_epd/epdconfig.py b/RaspberryPi_and_JetsonNano/python/lib/waveshare_epd/epdconfig.py index b22b035..f117881 100644 --- a/RaspberryPi_and_JetsonNano/python/lib/waveshare_epd/epdconfig.py +++ b/RaspberryPi_and_JetsonNano/python/lib/waveshare_epd/epdconfig.py @@ -32,7 +32,6 @@ import logging import sys import time - class RaspberryPi: # Pin definition RST_PIN = 17 @@ -62,6 +61,10 @@ class RaspberryPi: self.SPI.writebytes(data) def module_init(self): + # issue #36 - cannot wake from sleep + # once self.module_exit is called, the SPI.close() call prevents reiniting the device + # this explicitly calls the __init__ method to ensure that self.SPI is available + self.__init__() self.GPIO.setmode(self.GPIO.BCM) self.GPIO.setwarnings(False) self.GPIO.setup(self.RST_PIN, self.GPIO.OUT)