build and board info into critical error message
This commit is contained in:
parent
83573aa1b1
commit
160d034635
|
@ -36,5 +36,5 @@ EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=GPIOG_14 -DEFI_CONSOLE_RX_BRAI
|
|||
|
||||
|
||||
# Add them all together
|
||||
DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"microRusEfi\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(EFI_CONSOLE_TTL_PINS)
|
||||
DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DFIRMWARE_ID=\"microRusEFI\" $(DEFAULT_ENGINE_TYPE) $(LED_CRITICAL_ERROR_BRAIN_PIN) $(EFI_CONSOLE_TTL_PINS)
|
||||
|
||||
|
|
|
@ -253,6 +253,13 @@ void firmwareError(obd_code_e code, const char *fmt, ...) {
|
|||
// todo: reuse warning buffer helper method
|
||||
errorState.firmwareErrorMessageStream.buffer[errorState.firmwareErrorMessageStream.eos] = 0; // need to terminate explicitly
|
||||
}
|
||||
int size = strlen((char*)criticalErrorMessageBuffer);
|
||||
static char versionBuffer[32];
|
||||
chsnprintf(versionBuffer, sizeof(versionBuffer), " %d@%s", getRusEfiVersion(), FIRMWARE_ID);
|
||||
|
||||
if (size + strlen(versionBuffer) < sizeof(criticalErrorMessageBuffer)) {
|
||||
strcpy((char*)(criticalErrorMessageBuffer) + size, versionBuffer);
|
||||
}
|
||||
|
||||
#else
|
||||
printf("firmwareError [%s]\r\n", fmt);
|
||||
|
|
Loading…
Reference in New Issue