compile-time enforcement of printf strings

only:uaefi
This commit is contained in:
Andrey 2024-06-10 21:05:42 -04:00
parent 80ed4f694e
commit 53f99bd0a0
5 changed files with 8 additions and 6 deletions

View File

@ -928,8 +928,10 @@ void triggerInfo(void) {
#endif /* HAL_TRIGGER_USE_PAL */
efiPrintf("Template %s (%d) trigger %s (%d) syncEdge=%s tdcOffset=%.2f",
getEngine_type_e(engineConfiguration->engineType), engineConfiguration->engineType,
getTrigger_type_e(engineConfiguration->trigger.type), engineConfiguration->trigger.type,
getEngine_type_e(engineConfiguration->engineType),
(int)engineConfiguration->engineType,
getTrigger_type_e(engineConfiguration->trigger.type),
(int)engineConfiguration->trigger.type,
getSyncEdge(TRIGGER_WAVEFORM(syncEdge)), TRIGGER_WAVEFORM(tdcPosition));
if (engineConfiguration->trigger.type == trigger_type_e::TT_TOOTHED_WHEEL) {

View File

@ -124,7 +124,7 @@ static void updateTriggerWaveformIfNeeded(PwmConfig *state) {
if (atTriggerVersions[channel] < triggerEmulatorWaveforms[channel]->version) {
atTriggerVersions[channel] = triggerEmulatorWaveforms[channel]->version;
efiPrintf("Stimulator: updating trigger shape for ch%d: %d/%d %d", channel, atTriggerVersions[channel],
efiPrintf("Stimulator: updating trigger shape for ch%d: %d/%d %ld", channel, atTriggerVersions[channel],
engine->getGlobalConfigurationVersion(), getTimeNowMs());
copyPwmParameters(state, &triggerEmulatorWaveforms[channel]->wave);

View File

@ -133,7 +133,7 @@ void ButtonDebounce::debug() {
ButtonDebounce *listItem = s_firstDebounce;
while (listItem != nullptr) {
#if EFI_PROD_CODE || EFI_UNIT_TEST
efiPrintf("%s timeLast %d", listItem->m_name, listItem->timeLast);
efiPrintf("%s timeLast %f", listItem->m_name, listItem->timeLast.getElapsedSeconds());
efiPrintf("physical pin state %d", listItem->getPhysicalState());
efiPrintf("state %d", listItem->storedValue);
efiPrintf("mode %d", listItem->active_mode);

View File

@ -112,7 +112,7 @@ void StepperMotorBase::setInitialPosition() {
m_currentPosition = 0;
saveStepperPos(m_currentPosition);
// todo: is this a slow operation on the start-up path?
efiPrintf("Stepper: parking finished time=%dms", getTimeNowMs());
efiPrintf("Stepper: parking finished time=%lums", getTimeNowMs());
} else {
// The initial target position should correspond to the saved stepper position.
// Idle thread starts later and sets a new target position.

View File

@ -80,7 +80,7 @@ void initFlexSensor(bool isFirstTime) {
efiPrintf("lowFlexCallbackCounter counter %d", lowFlexCallbackCounter);
efiPrintf("flex freq %f", frequency);
efiPrintf("pulseWidthUs %f", pulseWidthUs);
efiPrintf("latestCallbackTime %d", latestCallbackTime);
efiPrintf("latestCallbackTime %lld", latestCallbackTime);
});
}