fossasia / susi_linux

Hardware for SUSI AI https://susi.ai
Apache License 2.0
1.61k stars 149 forks source link

import GPIO if possible to support GPIO module loading on RPi #490

Closed norbusan closed 5 years ago

norbusan commented 5 years ago

Tests on real hardware showed that with useGPIO=True, that is on Raspberry hardware, the recognizing state and busy state cannot call GPIO because the module is never imported.

Fix this by loading the module if possible, without erroring out. We already report whether we support GPIO or not.

The actual calls to GPIO functions are already protected by useGPIO so no further changes are necessary.