From 50cc06021b550d2161ac72ca2654474afa18be57 Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 12 May 2020 16:00:13 +0200 Subject: [PATCH] Only stopping hardware interface on automated initialization (#143) --- src/Module.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Module.cpp b/src/Module.cpp index 67ac9ac8..eed3e298 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -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(); }