From d7ffa9792e652b0cfb68dd88fcbd9cc67108c98a Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Fri, 3 Feb 2023 05:04:21 -0300 Subject: [PATCH] Adding state to errors, and reset --- examples/LinkWireless_demo/src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/LinkWireless_demo/src/main.cpp b/examples/LinkWireless_demo/src/main.cpp index c081a91..c7ee247 100644 --- a/examples/LinkWireless_demo/src/main.cpp +++ b/examples/LinkWireless_demo/src/main.cpp @@ -4,11 +4,13 @@ // (0) Include the header #include "../../_lib/LinkWireless.h" -#define CHECK_ERRORS(MESSAGE) \ - if ((lastError = linkWireless->getLastError())) { \ - log(std::string(MESSAGE) + " (" + std::to_string(lastError) + ")"); \ - hang(); \ - return; \ +#define CHECK_ERRORS(MESSAGE) \ + if ((lastError = linkWireless->getLastError())) { \ + log(std::string(MESSAGE) + " (" + std::to_string(lastError) + ") [" + \ + std::to_string(linkWireless->getState()) + "]"); \ + hang(); \ + linkWireless->activate(); \ + return; \ } void activate();