diff --git a/src/TaskRadiolib.cpp b/src/TaskRadiolib.cpp index a887ece..cc28f56 100644 --- a/src/TaskRadiolib.cpp +++ b/src/TaskRadiolib.cpp @@ -164,6 +164,9 @@ bool RadiolibTask::loop(System &system) { } else { if (!txEnable) { // system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX is not enabled", timeString().c_str()); + if (!_toModem.empty()) { + _toModem.getElement(); // empty list, otherwise memory will get full. + } } else { if (transmitFlag) { // system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "[%s] TX signal detected. Waiting TX", timeString().c_str()); @@ -182,8 +185,6 @@ bool RadiolibTask::loop(System &system) { return true; } } - } else { - _toModem.getElement(); // empty list, otherwise memory will get full. } } }