From db0ab41ea444d1367dd754a3b7f9f995427fc391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 2 Jan 2023 16:03:49 +0100 Subject: [PATCH] [realtek-ambz] Check SoftwareSerial before stopping --- .../realtek-ambz/libraries/SoftwareSerial/SoftwareSerial.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arduino/realtek-ambz/libraries/SoftwareSerial/SoftwareSerial.cpp b/arduino/realtek-ambz/libraries/SoftwareSerial/SoftwareSerial.cpp index a9e5da8..75cc4d4 100644 --- a/arduino/realtek-ambz/libraries/SoftwareSerial/SoftwareSerial.cpp +++ b/arduino/realtek-ambz/libraries/SoftwareSerial/SoftwareSerial.cpp @@ -83,6 +83,8 @@ void SoftwareSerial::begin(unsigned long baudrate, uint16_t config) { } void SoftwareSerial::end() { + if (!(bool)this) + return; gtimer_stop(OBJ); gtimer_deinit(OBJ); free(OBJ);