Merge pull request #214 from raven-worx/gpio_reset

only cleanup the GPIOs in use instead of all GPIOs (Python)
This commit is contained in:
Sherlock 2021-12-29 09:39:52 +08:00 committed by GitHub
commit fb3ce18166
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,7 @@ class RaspberryPi:
self.GPIO.output(self.RST_PIN, 0)
self.GPIO.output(self.DC_PIN, 0)
self.GPIO.cleanup()
self.GPIO.cleanup([self.RST_PIN, self.DC_PIN, self.CS_PIN, self.BUSY_PIN])
class JetsonNano:
@ -145,7 +145,7 @@ class JetsonNano:
self.GPIO.output(self.RST_PIN, 0)
self.GPIO.output(self.DC_PIN, 0)
self.GPIO.cleanup()
self.GPIO.cleanup([self.RST_PIN, self.DC_PIN, self.CS_PIN, self.BUSY_PIN])
if os.path.exists('/sys/bus/platform/drivers/gpiomem-bcm2835'):