diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index c607f4d343..a5f41dc5fd 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -432,6 +432,7 @@ static void printInfo(systime_t nowSeconds) { static systime_t timeOfPreviousReport = (systime_t) -1; extern fatal_msg_t errorMessageBuffer; +extern bool consoleInBinaryMode; /** * @brief Sends all pending data to dev console @@ -442,7 +443,9 @@ void updateDevConsoleState(void) { } // looks like this is not needed anymore // checkIfShouldHalt(); - printPending(); + if (!consoleInBinaryMode) { + printPending(); + } /** * this should go before the firmware error so that console can detect connection diff --git a/firmware/util/loggingcentral.cpp b/firmware/util/loggingcentral.cpp index c905021f55..84f0c68046 100644 --- a/firmware/util/loggingcentral.cpp +++ b/firmware/util/loggingcentral.cpp @@ -73,7 +73,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { int expectedOutputSize; #endif /* EFI_ENABLE_ASSERTS */ { // start of critical section - lockOutputBuffer(); + bool alreadyLocked = lockOutputBuffer(); /** * we cannot output under syslock, we simply rotate which buffer is which */ @@ -88,7 +88,9 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { accumulatedSize = 0; accumulationBuffer[0] = 0; - unlockOutputBuffer(); + if (!alreadyLocked) { + unlockOutputBuffer(); + } } // end of critical section *actualOutputBufferSize = efiStrlen(outputBuffer); @@ -104,16 +106,12 @@ char * swapOutputBuffers(int *actualOutputBufferSize) { return outputBuffer; } -extern bool consoleInBinaryMode; - /** * This method actually sends all the pending data to the communication layer. * This method is invoked by the main thread - that's the only thread which should be sending * actual data to console in order to avoid concurrent access to serial hardware. */ void printPending(void) { - if (consoleInBinaryMode) - return; int actualOutputBufferSize; char *output = swapOutputBuffers(&actualOutputBufferSize);