diff --git a/lib/Hoymiles/src/Hoymiles.cpp b/lib/Hoymiles/src/Hoymiles.cpp index 3a9999f..29b239a 100644 --- a/lib/Hoymiles/src/Hoymiles.cpp +++ b/lib/Hoymiles/src/Hoymiles.cpp @@ -12,7 +12,9 @@ #include "inverters/HM_4CH.h" #include -#define HOY_SEMAPHORE_TAKE() xSemaphoreTake(_xSemaphore, portMAX_DELAY) +#define HOY_SEMAPHORE_TAKE() \ + do { \ + } while (xSemaphoreTake(_xSemaphore, portMAX_DELAY) != pdPASS) #define HOY_SEMAPHORE_GIVE() xSemaphoreGive(_xSemaphore) HoymilesClass Hoymiles; diff --git a/src/MessageOutput.cpp b/src/MessageOutput.cpp index 2a84816..dc9c671 100644 --- a/src/MessageOutput.cpp +++ b/src/MessageOutput.cpp @@ -8,7 +8,9 @@ MessageOutputClass MessageOutput; -#define MSG_LOCK() xSemaphoreTake(_lock, portMAX_DELAY) +#define MSG_LOCK() \ + do { \ + } while (xSemaphoreTake(_lock, portMAX_DELAY) != pdPASS) #define MSG_UNLOCK() xSemaphoreGive(_lock) MessageOutputClass::MessageOutputClass() @@ -45,7 +47,7 @@ void MessageOutputClass::loop() _ws->textAll(_buffer, _buff_pos); _buff_pos = 0; } - if(_forceSend) { + if (_forceSend) { _buff_pos = 0; } MSG_UNLOCK();