mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
4261c0b416
commit
fc213cf03a
|
@ -106,7 +106,7 @@
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1678253866" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1678253866" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
|
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
|
||||||
</option>
|
</option>
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.183179237" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="-fgnu89-inline -c -Werror=type-limits" valueType="string"/>
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other.183179237" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.other" useByScannerDiscovery="true" value="-fgnu89-inline -c -Werror=type-limits -Werror=uninitialized" valueType="string"/>
|
||||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1472643596" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1472643596" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.816044947" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.816044947" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||||
|
@ -167,7 +167,7 @@
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.729960344" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.729960344" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
|
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
|
||||||
</option>
|
</option>
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other.1628064604" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other" useByScannerDiscovery="true" value="-fgnu89-inline -c -Werror=type-limits" valueType="string"/>
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other.1628064604" name="Other compiler flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.other" useByScannerDiscovery="true" value="-fgnu89-inline -c -Werror=type-limits -Werror=uninitialized" valueType="string"/>
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti.770615701" name="Do not use RTTI (-fno-rtti)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti.770615701" name="Do not use RTTI (-fno-rtti)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.nortti" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
||||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions.1846214625" name="Do not use exceptions (-fno-exceptions)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions.1846214625" name="Do not use exceptions (-fno-exceptions)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.noexceptions" useByScannerDiscovery="true" value="true" valueType="boolean"/>
|
||||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.238419844" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
|
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.238419844" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "efilib.h"
|
#include "efilib.h"
|
||||||
|
|
||||||
|
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||||
|
|
||||||
typedef char log_buf_t[DL_OUTPUT_BUFFER];
|
typedef char log_buf_t[DL_OUTPUT_BUFFER];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,32 +65,44 @@ void scheduleLogging(Logging *logging) {
|
||||||
resetLogging(logging);
|
resetLogging(logging);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this method should always be invoked from the same thread!
|
||||||
|
*/
|
||||||
|
char * swapOutputBuffers(int *actualOutputBufferSize) {
|
||||||
|
int expectedOutputSize;
|
||||||
|
{ // start of critical section
|
||||||
|
lockOutputBuffer();
|
||||||
|
/**
|
||||||
|
* we cannot output under syslock, we simply rotate which buffer is which
|
||||||
|
*/
|
||||||
|
char *temp = outputBuffer;
|
||||||
|
|
||||||
|
expectedOutputSize = accumulatedSize;
|
||||||
|
outputBuffer = accumulationBuffer;
|
||||||
|
|
||||||
|
accumulationBuffer = temp;
|
||||||
|
accumulatedSize = 0;
|
||||||
|
accumulationBuffer[0] = 0;
|
||||||
|
|
||||||
|
unlockOutputBuffer();
|
||||||
|
} // end of critical section
|
||||||
|
|
||||||
|
*actualOutputBufferSize = efiStrlen(outputBuffer);
|
||||||
|
efiAssert(*actualOutputBufferSize == expectedOutputSize, "out constr", NULL);
|
||||||
|
return outputBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method actually sends all the pending data to the communication layer.
|
* 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
|
* 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.
|
* actual data to console in order to avoid concurrent access to serial hardware.
|
||||||
*/
|
*/
|
||||||
void printPending(void) {
|
void printPending(void) {
|
||||||
lockOutputBuffer();
|
int actualOutputBufferSize;
|
||||||
/**
|
char *output = swapOutputBuffers(&actualOutputBufferSize);
|
||||||
* we cannot output under syslock, we simply rotate which buffer is which
|
|
||||||
*/
|
|
||||||
char *temp = outputBuffer;
|
|
||||||
|
|
||||||
int expectedOutputSize = accumulatedSize;
|
if (actualOutputBufferSize > 0) {
|
||||||
outputBuffer = accumulationBuffer;
|
printWithLength(output);
|
||||||
|
|
||||||
accumulationBuffer = temp;
|
|
||||||
accumulatedSize = 0;
|
|
||||||
accumulationBuffer[0] = 0;
|
|
||||||
|
|
||||||
unlockOutputBuffer();
|
|
||||||
|
|
||||||
int actualOutputBuffer = efiStrlen(outputBuffer);
|
|
||||||
efiAssertVoid(actualOutputBuffer == expectedOutputSize, "out constr");
|
|
||||||
|
|
||||||
if (actualOutputBuffer > 0) {
|
|
||||||
printWithLength(outputBuffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,3 +113,5 @@ void initLoggingCentral(void) {
|
||||||
outputBuffer = pendingBuffers1;
|
outputBuffer = pendingBuffers1;
|
||||||
accumulatedSize = 0;
|
accumulatedSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
|
@ -7,6 +7,7 @@ UTILSRC = $(UTIL_TEST_SRC)
|
||||||
|
|
||||||
UTILSRC_CPP = $(PROJECT_DIR)/util/cyclic_buffer.cpp \
|
UTILSRC_CPP = $(PROJECT_DIR)/util/cyclic_buffer.cpp \
|
||||||
$(PROJECT_DIR)/console_util/datalogging.cpp \
|
$(PROJECT_DIR)/console_util/datalogging.cpp \
|
||||||
|
$(PROJECT_DIR)/console_util/loggingcentral.cpp \
|
||||||
$(PROJECT_DIR)/util/listener_array.cpp \
|
$(PROJECT_DIR)/util/listener_array.cpp \
|
||||||
$(PROJECT_DIR)/util/cli_registry.cpp \
|
$(PROJECT_DIR)/util/cli_registry.cpp \
|
||||||
$(PROJECT_DIR)/util/efilib.cpp \
|
$(PROJECT_DIR)/util/efilib.cpp \
|
||||||
|
|
Loading…
Reference in New Issue