diff --git a/firmware/console/binary/bluetooth.cpp b/firmware/console/binary/bluetooth.cpp index 417dabe06b..c3fa119925 100644 --- a/firmware/console/binary/bluetooth.cpp +++ b/firmware/console/binary/bluetooth.cpp @@ -137,7 +137,7 @@ static void runCommands(SerialTsChannelBase* tsChannel) { return; } - efiPrintf("Restarting at %d", baudRates[baudIdx].rate); + efiPrintf("Restarting at %lu", baudRates[baudIdx].rate); tsChannel->start(baudRates[baudIdx].rate); chThdSleepMilliseconds(10); // safety diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 5961dea941..20751414a3 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -230,6 +230,7 @@ void TunerStudio::handleCrc32Check(TsChannelBase *tsChannel, uint16_t offset, ui uint32_t crc = SWAP_UINT32(crc32(start, count)); tsChannel->sendResponse(TS_CRC, (const uint8_t *) &crc, 4); + efiPrintf("TS <- Get CRC offset %d count %d result %08x", offset, count, (unsigned int)crc); } #if EFI_TS_SCATTER @@ -591,7 +592,7 @@ static int tsProcessOne(TsChannelBase* tsChannel) { /* send error only if previously we were in sync */ if (tsChannel->in_sync) { efiPrintf("TunerStudio: command %c actual CRC %x/expected %x", tsChannel->scratchBuffer[0], - actualCrc, expectedCrc); + (unsigned int)actualCrc, (unsigned int)expectedCrc); tunerStudioError(tsChannel, "ERROR: CRC issue"); sendErrorCode(tsChannel, TS_RESPONSE_CRC_FAILURE); tsChannel->in_sync = false; diff --git a/firmware/console/eficonsole.cpp b/firmware/console/eficonsole.cpp index ebc7e041d5..7704929cba 100644 --- a/firmware/console/eficonsole.cpp +++ b/firmware/console/eficonsole.cpp @@ -191,7 +191,7 @@ static void cmd_threads() { while (tp) { int freeBytes = CountFreeStackSpace(tp->wabase); - efiPrintf("%s\t%08x\t%lu\t%d", tp->name, tp->wabase, tp->time, freeBytes); + efiPrintf("%s\t%08x\t%lu\t%d", tp->name, (unsigned int)tp->wabase, tp->time, freeBytes); if (freeBytes < 100) { criticalError("Ran out of stack on thread %s, %d bytes remain", tp->name, freeBytes); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index ca49a085e8..a88bb64e11 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -99,7 +99,7 @@ static void printRusefiVersion(const char *engineTypeName, const char *firmwareB getRusEfiVersion(), SIGNATURE_HASH, firmwareBuildId, engineTypeName, - getTimeNowS()); + (uint32_t)getTimeNowS()); } #if EFI_PROD_CODE diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 7a4a7ddfb9..23db481eb9 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -376,7 +376,7 @@ void Engine::OnTriggerSynchronization(bool wasSynchronized, bool isDecodingError if (isDecodingError) { #if EFI_PROD_CODE if (engineConfiguration->verboseTriggerSynchDetails || (triggerCentral.triggerState.someSortOfTriggerError() && !engineConfiguration->silentTriggerError)) { - efiPrintf("error: synchronizationPoint @ index %d expected %d/%d got %d/%d", + efiPrintf("error: synchronizationPoint @ index %lu expected %d/%d got %d/%d", triggerCentral.triggerState.currentCycle.current_index, triggerCentral.triggerShape.getExpectedEventCount(TriggerWheel::T_PRIMARY), triggerCentral.triggerShape.getExpectedEventCount(TriggerWheel::T_SECONDARY), diff --git a/firmware/controllers/algo/runtime_state.cpp b/firmware/controllers/algo/runtime_state.cpp index 328d52a9f2..2e30fc2778 100644 --- a/firmware/controllers/algo/runtime_state.cpp +++ b/firmware/controllers/algo/runtime_state.cpp @@ -40,11 +40,11 @@ void resetMaxValues() { } void printRuntimeStats(void) { - efiPrintf("maxSchedulingPrecisionLoss=%d", maxSchedulingPrecisionLoss); + efiPrintf("maxSchedulingPrecisionLoss=%lu", maxSchedulingPrecisionLoss); #if EFI_CLOCK_LOCKS - efiPrintf("maxLockedDuration=%d / maxTriggerReentrant=%d", maxLockedDuration, maxTriggerReentrant); + efiPrintf("maxLockedDuration=%lu / maxTriggerReentrant=%d", maxLockedDuration, maxTriggerReentrant); #endif // EFI_CLOCK_LOCKS - efiPrintf("maxEventCallbackDuration=%d", maxEventCallbackDuration); + efiPrintf("maxEventCallbackDuration=%lu", maxEventCallbackDuration); } diff --git a/firmware/controllers/core/error_handling.cpp b/firmware/controllers/core/error_handling.cpp index 382ac39fe6..c151bc109d 100644 --- a/firmware/controllers/core/error_handling.cpp +++ b/firmware/controllers/core/error_handling.cpp @@ -80,7 +80,7 @@ void checkLastBootError() { sramState->Err.BootCount = 0; } - efiPrintf("Power cycle count: %d", sramState->Err.BootCount); + efiPrintf("Power cycle count: %lu", sramState->Err.BootCount); sramState->Err.BootCount++; #endif // EFI_BACKUP_SRAM } diff --git a/firmware/controllers/engine_cycle/prime_injection.cpp b/firmware/controllers/engine_cycle/prime_injection.cpp index b6107102f5..397ed8897c 100644 --- a/firmware/controllers/engine_cycle/prime_injection.cpp +++ b/firmware/controllers/engine_cycle/prime_injection.cpp @@ -67,7 +67,7 @@ void PrimeController::onIgnitionStateChanged(bool ignitionOn) { auto startTime = getTimeNowNt() + primeDelayNt; getExecutorInterface()->scheduleByTimestampNt("primingDelay", nullptr, startTime, { PrimeController::onPrimeStartAdapter, this }); } else { - efiPrintf("Skipped priming pulse since ignSwitchCounter = %d", ignSwitchCounter); + efiPrintf("Skipped priming pulse since ignSwitchCounter = %lu", ignSwitchCounter); } // we'll reset it later when the engine starts diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index 6dec9cdd88..36d327b3de 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -312,7 +312,7 @@ void readFromFlash() { break; case FlashState::IncompatibleVersion: // Preserve engine type from old config - efiPrintf("Resetting due to version mismatch but preserving engine type [%d]", engineConfiguration->engineType); + efiPrintf("Resetting due to version mismatch but preserving engine type [%d]", (int)engineConfiguration->engineType); resetConfigurationExt(engineConfiguration->engineType); break; case FlashState::Ok: diff --git a/firmware/controllers/lua/can_filter.cpp b/firmware/controllers/lua/can_filter.cpp index 6274adc4f0..1649f6cafa 100644 --- a/firmware/controllers/lua/can_filter.cpp +++ b/firmware/controllers/lua/can_filter.cpp @@ -31,7 +31,7 @@ void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback) { criticalError("Too many Lua CAN RX filters"); } - efiPrintf("Added Lua CAN RX filter id 0x%x mask 0x%x with%s custom function", eid, mask, (callback == -1 ? "out" : "")); + efiPrintf("Added Lua CAN RX filter id 0x%x mask 0x%x with%s custom function", (unsigned int)eid, (unsigned int)mask, (callback == -1 ? "out" : "")); filters[filterCount].Id = eid; filters[filterCount].Mask = mask; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 150956e9c8..75750b0ace 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -949,11 +949,11 @@ void triggerInfo(void) { TRIGGER_WAVEFORM(getExpectedEventCount(TriggerWheel::T_PRIMARY)), TRIGGER_WAVEFORM(getExpectedEventCount(TriggerWheel::T_SECONDARY))); - efiPrintf("trigger type=%d/need2ndChannel=%s", engineConfiguration->trigger.type, + efiPrintf("trigger type=%d/need2ndChannel=%s", (int)engineConfiguration->trigger.type, boolToString(TRIGGER_WAVEFORM(needSecondTriggerInput))); - efiPrintf("synchronizationNeeded=%s/isError=%s/total errors=%d ord_err=%d/total revolutions=%d/self=%s", + efiPrintf("synchronizationNeeded=%s/isError=%s/total errors=%lu ord_err=%lu/total revolutions=%d/self=%s", boolToString(ts->isSynchronizationNeeded), boolToString(tc->isTriggerDecoderError()), tc->triggerState.totalTriggerErrorCounter, @@ -1000,7 +1000,7 @@ void triggerInfo(void) { efiPrintf("secondary logic input: %s", hwPortname(engineConfiguration->logicAnalyzerPins[1])); - efiPrintf("totalTriggerHandlerMaxTime=%d", triggerMaxDuration); + efiPrintf("totalTriggerHandlerMaxTime=%lu", triggerMaxDuration); #endif /* EFI_PROD_CODE */ diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 72d1b9e8be..09ec4b23de 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -482,16 +482,13 @@ expected TriggerDecoderBase::decodeTriggerEvent( float gap = 1.0 * toothDurations[i] / toothDurations[i + 1]; if (cisnan(gap)) { - efiPrintf("%s index=%d NaN gap, you have noise issues?", - i, - prefix - ); + efiPrintf("%s index=%d NaN gap, you have noise issues?", prefix, i); } else { float ratioTo = triggerShape.synchronizationRatioTo[i]; bool gapOk = isInRange(ratioFrom, gap, ratioTo); - efiPrintf("%s %srpm=%d time=%d eventIndex=%d gapIndex=%d: %s gap=%.3f expected from %.3f to %.3f error=%s", + efiPrintf("%s %srpm=%d time=%d eventIndex=%lu gapIndex=%d: %s gap=%.3f expected from %.3f to %.3f error=%s", prefix, triggerConfiguration.PrintPrefix, (int)Sensor::getOrZero(SensorType::Rpm), diff --git a/firmware/development/engine_sniffer.cpp b/firmware/development/engine_sniffer.cpp index 19d1e4775a..d750d11883 100644 --- a/firmware/development/engine_sniffer.cpp +++ b/firmware/development/engine_sniffer.cpp @@ -119,7 +119,7 @@ int WaveChart::getSize() { #if ! EFI_UNIT_TEST static void printStatus() { efiPrintf("engine sniffer: %s", boolToString(getTriggerCentral()->isEngineSnifferEnabled)); - efiPrintf("engine sniffer size=%d", engineConfiguration->engineChartSize); + efiPrintf("engine sniffer size=%lu", engineConfiguration->engineChartSize); } void setChartSize(int newSize) { diff --git a/firmware/hw_layer/adc/adc_inputs.cpp b/firmware/hw_layer/adc/adc_inputs.cpp index f7423666b8..5336f791ce 100644 --- a/firmware/hw_layer/adc/adc_inputs.cpp +++ b/firmware/hw_layer/adc/adc_inputs.cpp @@ -325,7 +325,7 @@ static void printAdcChannedReport(const char *prefix, int internalIndex, adc_cha void printFullAdcReport(void) { #if EFI_USE_FAST_ADC - efiPrintf("fast %d samples", fastAdc.conversionCount); + efiPrintf("fast %lu samples", fastAdc.conversionCount); for (int internalIndex = 0; internalIndex < fastAdc.size(); internalIndex++) { adc_channel_e hwChannel = fastAdc.getAdcChannelByInternalIndex(internalIndex); @@ -333,7 +333,7 @@ void printFullAdcReport(void) { printAdcChannedReport("F", internalIndex, hwChannel); } #endif // EFI_USE_FAST_ADC - efiPrintf("slow %d samples", slowAdcConversionCount); + efiPrintf("slow %lu samples", slowAdcConversionCount); /* we assume that all slow ADC channels are enabled */ for (int internalIndex = 0; internalIndex < ADC_MAX_CHANNELS_COUNT; internalIndex++) { diff --git a/firmware/hw_layer/drivers/can/can_msg_tx.cpp b/firmware/hw_layer/drivers/can/can_msg_tx.cpp index b769abdd9a..236ee7a6f4 100644 --- a/firmware/hw_layer/drivers/can/can_msg_tx.cpp +++ b/firmware/hw_layer/drivers/can/can_msg_tx.cpp @@ -81,9 +81,9 @@ CanTxMessage::~CanTxMessage() { getCanCategory(category), busIndex, #ifndef STM32H7XX - (m_frame.IDE == CAN_IDE_EXT) ? CAN_EID(m_frame) : CAN_SID(m_frame), + (unsigned int)((m_frame.IDE == CAN_IDE_EXT) ? CAN_EID(m_frame) : CAN_SID(m_frame)), #else - m_frame.common.XTD ? CAN_EID(m_frame) : CAN_SID(m_frame), + (unsigned int)(m_frame.common.XTD ? CAN_EID(m_frame) : CAN_SID(m_frame)), #endif m_frame.DLC, m_frame.data8[0], m_frame.data8[1], diff --git a/firmware/hw_layer/drivers/sent/sent.cpp b/firmware/hw_layer/drivers/sent/sent.cpp index ac2f48ecab..5418a7ac16 100644 --- a/firmware/hw_layer/drivers/sent/sent.cpp +++ b/firmware/hw_layer/drivers/sent/sent.cpp @@ -510,8 +510,8 @@ void sent_channel::Info(void) { uint8_t stat; uint16_t sig0, sig1; - efiPrintf("Unit time %d CPU ticks %f uS", tickPerUnit, TicksToUs(getTickTime())); - efiPrintf("Total pulses %d", pulseCounter); + efiPrintf("Unit time %lu CPU ticks %f uS", tickPerUnit, TicksToUs(getTickTime())); + efiPrintf("Total pulses %lu", pulseCounter); if (GetSignals(&stat, &sig0, &sig1) == 0) { efiPrintf("Last valid fast msg Status 0x%01x Sig0 0x%03x Sig1 0x%03x", stat, sig0, sig1); @@ -527,11 +527,11 @@ void sent_channel::Info(void) { } #if SENT_STATISTIC_COUNTERS - efiPrintf("Restarts %d", statistic.RestartCnt); - efiPrintf("Interval errors %d short, %d long", statistic.ShortIntervalErr, statistic.LongIntervalErr); - efiPrintf("Total frames %d with CRC error %d (%f%%)", statistic.FrameCnt, statistic.CrcErrCnt, statistic.CrcErrCnt * 100.0 / statistic.FrameCnt); - efiPrintf("Total slow channel messages %d with crc6 errors %d (%f%%)", statistic.sc, statistic.scCrcErr, statistic.scCrcErr * 100.0 / statistic.sc); - efiPrintf("Sync errors %d", statistic.SyncErr); + efiPrintf("Restarts %lu", statistic.RestartCnt); + efiPrintf("Interval errors %lu short, %lu long", statistic.ShortIntervalErr, statistic.LongIntervalErr); + efiPrintf("Total frames %lu with CRC error %lu (%f%%)", statistic.FrameCnt, statistic.CrcErrCnt, statistic.CrcErrCnt * 100.0 / statistic.FrameCnt); + efiPrintf("Total slow channel messages %lu with crc6 errors %lu (%f%%)", statistic.sc, statistic.scCrcErr, statistic.scCrcErr * 100.0 / statistic.sc); + efiPrintf("Sync errors %lu", statistic.SyncErr); #endif } diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index d0a440513d..0fb929e63d 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -280,7 +280,7 @@ static void listDirectory(const char *path) { if ((fno.fattrib & AM_DIR) || mystrncasecmp(RUSEFI_LOG_PREFIX, fno.fname, sizeof(RUSEFI_LOG_PREFIX) - 1)) { continue; } - efiPrintf("logfile%lu:%s", fno.fsize, fno.fname); + efiPrintf("logfile %lu:%s", (uint32_t)fno.fsize, fno.fname); count++; // efiPrintf("%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu %-12s", (fno.fattrib & AM_DIR) ? 'D' : '-', diff --git a/firmware/hw_layer/rtc_helper.cpp b/firmware/hw_layer/rtc_helper.cpp index a9159b1ad9..21fe9bbeeb 100644 --- a/firmware/hw_layer/rtc_helper.cpp +++ b/firmware/hw_layer/rtc_helper.cpp @@ -42,7 +42,7 @@ static const char * const monthAbbrs[] = { void printRtcDateTime() { efidatetime_t dateTime = getRtcDateTime(); // prints the date like: 19 sep 2022 21:19:55 - efiPrintf("Current RTC time: %02u %s %04u %02u:%02u:%02u", + efiPrintf("Current RTC time: %02u %s %04lu %02u:%02u:%02u", dateTime.day, monthAbbrs[dateTime.month - 1], dateTime.year, dateTime.hour, dateTime.minute, dateTime.second); } diff --git a/firmware/util/math/interpolation.cpp b/firmware/util/math/interpolation.cpp index fe08a17f7c..a51a1326bb 100644 --- a/firmware/util/math/interpolation.cpp +++ b/firmware/util/math/interpolation.cpp @@ -47,14 +47,14 @@ static void testBinary() { } timeNew = getTimeNowLowerNt() - start; } - efiPrintf("for v=%d old=%d ticks", v, timeOld); - efiPrintf("for v=%d new=%d ticks", v, timeNew); + efiPrintf("for v=%d old=%lu ticks", v, timeOld); + efiPrintf("for v=%d new=%lu ticks", v, timeNew); totalOld += timeOld; totalNew += timeNew; } - efiPrintf("totalOld=%d ticks", totalOld); - efiPrintf("totalNew=%d ticks", totalNew); + efiPrintf("totalOld=%lu ticks", totalOld); + efiPrintf("totalNew=%lu ticks", totalNew); }