compile-time enforcement of printf strings

only:uaefi
This commit is contained in:
Andrey 2024-06-10 21:22:56 -04:00
parent 53f99bd0a0
commit 7b40c58d79
3 changed files with 14 additions and 13 deletions

View File

@ -1029,7 +1029,7 @@ void initElectronicThrottle() {
efiPrintf("TPS=%.2f", Sensor::getOrZero(SensorType::Tps1));
efiPrintf("ETB1 duty=%.2f",
engine->outputChannels.etb1DutyCycle);
(float)engine->outputChannels.etb1DutyCycle);
efiPrintf("ETB freq=%d",
engineConfiguration->etbFreq);

View File

@ -41,20 +41,20 @@ void checkLastBootError() {
efiPrintf("Last boot had line: %d", sramState->Err.hardLine);
efiPrintf("Last boot had check: %d", sramState->Err.check);
efiPrintf("Last boot had error: %s", sramState->Err.ErrorString);
efiPrintf("Last boot had hard fault type: %x addr: %x CSFR: %x", sramState->Err.FaultType, sramState->Err.FaultAddress, sramState->Err.Csfr);
efiPrintf("Last boot had hard fault type: %lx addr: %lx CSFR: %lx", sramState->Err.FaultType, sramState->Err.FaultAddress, sramState->Err.Csfr);
if (engineConfiguration->rethrowHardFault) {
criticalError("Last boot had hard fault type: %x addr: %x CSFR: %x", sramState->Err.FaultType, sramState->Err.FaultAddress, sramState->Err.Csfr);
criticalError("Last boot had hard fault type: %lx addr: %lx CSFR: %lx", sramState->Err.FaultType, sramState->Err.FaultAddress, sramState->Err.Csfr);
}
auto ctx = &sramState->Err.FaultCtx;
efiPrintf("r0 0x%x", ctx->r0);
efiPrintf("r1 0x%x", ctx->r1);
efiPrintf("r2 0x%x", ctx->r2);
efiPrintf("r3 0x%x", ctx->r3);
efiPrintf("r12 0x%x", ctx->r12);
efiPrintf("lr (thread) 0x%x", ctx->lr_thd);
efiPrintf("pc 0x%x", ctx->pc);
efiPrintf("xpsr 0x%x", ctx->xpsr);
efiPrintf("r0 0x%lx", ctx->r0);
efiPrintf("r1 0x%lx", ctx->r1);
efiPrintf("r2 0x%lx", ctx->r2);
efiPrintf("r3 0x%lx", ctx->r3);
efiPrintf("r12 0x%lx", ctx->r12);
efiPrintf("lr (thread) 0x%lx", ctx->lr_thd);
efiPrintf("pc 0x%lx", ctx->pc);
efiPrintf("xpsr 0x%lx", ctx->xpsr);
/* FPU registers - not very usefull for debug */
if (0) {

View File

@ -90,8 +90,9 @@ static void printOutputs() {
void printConfiguration() {
efiPrintf("Template %s/%d trigger %s/%s/%d", getEngine_type_e(engineConfiguration->engineType),
engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type),
getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), engineConfiguration->fuelAlgorithm);
(int)engineConfiguration->engineType,
getTrigger_type_e(engineConfiguration->trigger.type),
getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), (int)engineConfiguration->fuelAlgorithm);
efiPrintf("configurationVersion=%d", engine->getGlobalConfigurationVersion());