Skip to content

Commit

Permalink
flow debugger mutex no-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 25, 2021
1 parent 577d238 commit 61d1107
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bb3/flow/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void flushToDebuggerMessage() {

eez::mcu::ethernet::writeDebuggerBuffer(g_toDebuggerMessage, toDebuggerMessagePosition);

if (EEZ_MUTEX_WAIT(flowDebugger, 5)) {
if (EEZ_MUTEX_WAIT(flowDebugger, 0)) {
auto n = g_toDebuggerMessagePosition - toDebuggerMessagePosition;
if (n > 0) {
memmove(g_toDebuggerMessage, g_toDebuggerMessage + toDebuggerMessagePosition, n);
Expand All @@ -69,7 +69,7 @@ void dealWithCongestedBufferSituation(const char *buffer, uint32_t length) {
}
} while (g_toDebuggerMessagePosition + length > FLOW_TO_DEBUGGER_MESSAGE_BUFFER_SIZE);

if (EEZ_MUTEX_WAIT(flowDebugger, 5)) {
if (EEZ_MUTEX_WAIT(flowDebugger, 0)) {
memcpy(g_toDebuggerMessage + g_toDebuggerMessagePosition, buffer, length);
g_toDebuggerMessagePosition += length;
EEZ_MUTEX_RELEASE(flowDebugger);
Expand All @@ -83,7 +83,7 @@ void writeDebuggerBuffer(const char *buffer, uint32_t length) {
return;
}

if (EEZ_MUTEX_WAIT(flowDebugger, 5)) {
if (EEZ_MUTEX_WAIT(flowDebugger, 0)) {
if (g_toDebuggerMessagePosition + length > FLOW_TO_DEBUGGER_MESSAGE_BUFFER_SIZE) {
EEZ_MUTEX_RELEASE(flowDebugger);
dealWithCongestedBufferSituation(buffer, length);
Expand Down

0 comments on commit 61d1107

Please sign in to comment.