[Module] Fixed interface termination

This commit is contained in:
jgromes 2020-02-20 12:35:44 +01:00
parent 4459432998
commit 1a75ff837e

View file

@ -73,8 +73,17 @@ void Module::init(uint8_t interface) {
} }
void Module::term() { void Module::term() {
// stop SPI // stop hardware interface
_spi->end(); 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() { void Module::ATemptyBuffer() {