From 16073f05ea0464152139e0ed1e695fc135c72c6f Mon Sep 17 00:00:00 2001 From: jgromes Date: Thu, 20 Feb 2020 12:38:51 +0100 Subject: [PATCH] [Module] Fixed incorrect arguments --- src/Module.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Module.cpp b/src/Module.cpp index 90075b07..bce8abd4 100644 --- a/src/Module.cpp +++ b/src/Module.cpp @@ -73,16 +73,13 @@ void Module::init(uint8_t interface) { } void Module::term() { - // 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; + // stop hardware interfaces + if(_spi != nullptr) { + _spi->end(); + } + + if(ModuleSerial != nullptr) { + ModuleSerial->end(); } }