minor improvements

This commit is contained in:
rusefi 2017-06-03 22:27:05 -04:00
parent e6e75ab888
commit 382f28daf1
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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);