From 1a75ff837e33b6f8621ebbe734e7b8eeb4727398 Mon Sep 17 00:00:00 2001 From: jgromes Date: Thu, 20 Feb 2020 12:35:44 +0100 Subject: [PATCH] [Module] Fixed interface termination --- src/Module.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Module.cpp b/src/Module.cpp index 27181535..90075b07 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -73,8 +73,17 @@ void Module::init(uint8_t interface) { } void Module::term() { - // stop SPI - _spi->end(); + // stop hardware interface + switch(interface) { + case RADIOLIB_USE_SPI: + _spi->end(); + break; + case RADIOLIB_USE_UART: + ModuleSerial->end(baudrate, SERIAL_8N1, _rx, _tx); + break; + case RADIOLIB_USE_I2C: + break; + } } void Module::ATemptyBuffer() {