Only stopping hardware interface on automated initialization (#143)

This commit is contained in:
jgromes 2020-05-12 16:00:13 +02:00
parent 4198551e55
commit 50cc06021b

View file

@ -103,7 +103,11 @@ void Module::init(uint8_t interface) {
}
void Module::term() {
// stop hardware interfaces
// stop hardware interfaces (if they were initialized by the library)
if(!_initInterface) {
return;
}
if(_spi != nullptr) {
_spi->end();
}