auto-sync
This commit is contained in:
parent
c869ea6579
commit
6d0c94fc63
|
@ -165,7 +165,6 @@ void print(const char *format, ...) {
|
|||
}
|
||||
|
||||
void initializeConsole(Logging *sharedLogger) {
|
||||
initIntermediateLoggingBuffer();
|
||||
initConsoleLogic(sharedLogger);
|
||||
|
||||
startConsole(sharedLogger, &handleConsoleLine);
|
||||
|
|
|
@ -49,6 +49,7 @@ void chDbgPanic3(const char *msg, const char * file, int line) {
|
|||
|
||||
#define WARNING_BUFFER_SIZE 80
|
||||
static char warningBuffer[WARNING_BUFFER_SIZE];
|
||||
static bool isWarningStreamInitialized = false;
|
||||
static MemoryStream warningStream;
|
||||
|
||||
static int warningCounter = 0;
|
||||
|
@ -58,6 +59,7 @@ static int warningCounter = 0;
|
|||
* @returns TRUE in case there are too many warnings
|
||||
*/
|
||||
int warning(obd_code_e code, const char *fmt, ...) {
|
||||
efiAssert(isWarningStreamInitialized, "warn stream", false);
|
||||
UNUSED(code);
|
||||
|
||||
int now = getTimeNowSeconds();
|
||||
|
@ -111,6 +113,7 @@ void onUnlockHook(void) {
|
|||
|
||||
void initErrorHandling(void) {
|
||||
msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0);
|
||||
isWarningStreamInitialized = true;
|
||||
}
|
||||
|
||||
extern virtual_timers_list_t vtlist;
|
||||
|
|
|
@ -106,7 +106,7 @@ persisted_configuration_state_e flashState;
|
|||
* this method could and should be executed before we have any
|
||||
* connectivity so no console output here
|
||||
*/
|
||||
persisted_configuration_state_e readConfiguration(void) {
|
||||
persisted_configuration_state_e readConfiguration(Logging * logger) {
|
||||
efiAssert(getRemainingStack(chThdSelf()) > 256, "read f", PC_ERROR);
|
||||
flashRead(FLASH_ADDR, (char *) &persistentState, PERSISTENT_SIZE);
|
||||
|
||||
|
@ -131,10 +131,7 @@ persisted_configuration_state_e readConfiguration(void) {
|
|||
|
||||
void readFromFlash(void) {
|
||||
printMsg(logger, "readFromFlash()");
|
||||
readConfiguration();
|
||||
|
||||
persisted_configuration_state_e result = readConfiguration();
|
||||
|
||||
persisted_configuration_state_e result = readConfiguration(logger);
|
||||
|
||||
if (result == CRC_FAILED) {
|
||||
printMsg(logger, "Need to reset flash to default due to CRC");
|
||||
|
|
|
@ -21,7 +21,7 @@ typedef enum {
|
|||
PC_ERROR = 4
|
||||
} persisted_configuration_state_e;
|
||||
|
||||
persisted_configuration_state_e readConfiguration(void);
|
||||
persisted_configuration_state_e readConfiguration(Logging * logger);
|
||||
void readFromFlash(void);
|
||||
void initFlash(Logging *sharedLogger);
|
||||
|
||||
|
|
|
@ -166,12 +166,13 @@ void applyNewConfiguration(void) {
|
|||
|
||||
void runRusEfi(void) {
|
||||
efiAssertVoid(getRemainingStack(chThdSelf()) > 512, "init s");
|
||||
initIntermediateLoggingBuffer();
|
||||
|
||||
/**
|
||||
* First thing is reading configuration from flash memory.
|
||||
* In order to have complete flexibility configuration has to go before anything else.
|
||||
*/
|
||||
readConfiguration();
|
||||
// readConfiguration(&sharedLogger);
|
||||
|
||||
msObjectInit(&firmwareErrorMessageStream, errorMessageBuffer, sizeof(errorMessageBuffer), 0);
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ void initIntermediateLoggingBuffer(void) {
|
|||
initLoggingCentral();
|
||||
|
||||
msObjectInit(&intermediateLoggingBuffer, intermediateLoggingBufferData, INTERMEDIATE_LOGGING_BUFFER_SIZE, 0);
|
||||
intermediateLoggingBufferInited = TRUE;
|
||||
intermediateLoggingBufferInited = true;
|
||||
}
|
||||
|
||||
#endif /* ! EFI_UNIT_TEST */
|
||||
|
|
|
@ -71,6 +71,9 @@ void rusEfiFunctionalTest(void) {
|
|||
printToWin32Console("Running version:");
|
||||
printToWin32Console("TODO");
|
||||
|
||||
initIntermediateLoggingBuffer();
|
||||
// initErrorHandling();
|
||||
|
||||
initializeConsole(&sharedLogger);
|
||||
|
||||
initStatusLoop(engine);
|
||||
|
|
Loading…
Reference in New Issue