rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
efitime.cpp File Reference

Functions

efitick_t getTimeNowNt ()
 
efitimeus_t getTimeNowUs ()
 
efitimems_t getTimeNowMs ()
 Returns the 32 bit number of milliseconds since the board initialization.
 
efitimesec_t getTimeNowS ()
 Current system time in seconds (32 bits)
 

Variables

static WrapAround62 timeNt
 

Function Documentation

◆ getTimeNowMs()

efitimems_t getTimeNowMs ( )

Returns the 32 bit number of milliseconds since the board initialization.

32 bit return type overflows in 23(or46?) days. tag#4554. I think we do not expect rusEFI to run for 23 days straight days any time soon?

Definition at line 34 of file efitime.cpp.

34 {
35 return US2MS(getTimeNowUs());
36}
efitimeus_t getTimeNowUs()
Definition efitime.cpp:26

Referenced by assertTimeIsLinear(), printGpsInfo(), sayHello(), StepperMotorBase::setInitialPosition(), testMath(), testRusefiMethods(), testSystemCalls(), updateTriggerWaveformIfNeeded(), and writeSdBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeNowNt()

efitick_t getTimeNowNt ( )

64-bit counter CPU/timer cycles since MCU reset

Definition at line 19 of file efitime.cpp.

19 {
20 return timeNt.update(getTimeNowLowerNt());
21}
static WrapAround62 timeNt
Definition efitime.cpp:14
uint32_t getTimeNowLowerNt()

Referenced by WaveChart::addEvent3(), EtbController::checkJam(), comp_cam_callback(), comp_shaft_callback(), configureRusefiLuaHooks(), endSimultaneousInjectionOnlyTogglePins(), TriggerCentral::engineMovedRecently(), EngineState::EngineState(), SingleTimerExecutor::executeAllPendingActions(), EventQueue::executeOne(), fastAdcDoneCB(), fireSparkAndPrepareNextSchedule(), StoredValueSensor::get(), LuaPid::get(), LuaIndustrialPid::get(), getAcrState(), getAfr(), EtbController::getClosedLoop(), EtbController::getClosedLoopAutotune(), getTimeNowUs(), PwmConfig::handleCycleStart(), TriggerEmulatorHelper::handleEmulatorCallback(), handleExtiIsr(), initAdcInputs(), initMicrosecondTimer(), Engine::isInShutdownMode(), WaveChart::isStartedTooLongAgo(), HellenBoardIdFinder< NumPins >::measureChargingTimes(), VvtController::onFastCallback(), LimpManager::onFastCallback(), PrimeController::onIgnitionStateChanged(), PrimeController::onPrimeStart(), RpmCalculator::onSlowCallback(), onStartKnockSampling(), onTdcCallback(), EngineState::periodicFastCallback(), HpfpController::pinTurnOff(), HpfpController::pinTurnOn(), AemXSeriesWideband::refreshSmoothedLambda(), AemXSeriesWideband::refreshState(), Engine::resetEngineSnifferIfInTestMode(), runBench(), runOneLua(), SingleTimerExecutor::schedule(), SingleTimerExecutor::scheduleTimerCallback(), sentPressureDecode(), sentTpsDecode(), setHardwareSchedulerTimer(), setHysteresis(), TriggerDecoderBase::setShaftSynchronized(), startAveraging(), startSimultaneousInjection(), MapAverager::stop(), ButtonDebounce::stopConfiguration(), PeriodicController< TStackSize >::ThreadTask(), tle8888startup(), PwmConfig::togglePwmState(), triggerAdcCallback(), triggerScopeGetBuffer(), turnInjectionPinHigh(), turnInjectionPinLow(), turnInjectionPinLowStage2(), turnSparkPinHighStartCharging(), Lps25Sensor::update(), EngineState::updateTChargeK(), validateHardwareTimer(), watchDogBuddyCallback(), and writeToFlashNowImpl().

Here is the call graph for this function:

◆ getTimeNowS()

efitimesec_t getTimeNowS ( )

Current system time in seconds (32 bits)

32 bit integer number of seconds since ECU boot. 31,710 years - would not overflow during our life span.

Definition at line 42 of file efitime.cpp.

42 {
43 return getTimeNowUs() / US_PER_SECOND;
44}

Referenced by boardSdCardEnable(), configureRusefiLuaUtilHooks(), TriggerDecoderBase::decodeTriggerEvent(), AdcDevice::getAvgAdcValue(), handleTestCommand(), printVersionForConsole(), sendQcBenchBoardStatus(), timeInfo(), updateDevConsoleState(), and updateTunerStudioState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeNowUs()

efitimeus_t getTimeNowUs ( )

Variable Documentation

◆ timeNt

WrapAround62 timeNt
static

problem: we have three files with bits and pieces of time API and documentation 1) this implementation class 2) rusEFI header efitime.h 3) libfirmware header rusefi_time_types.h

Definition at line 14 of file efitime.cpp.

Referenced by getTimeNowNt(), and EventQueue::insertTask().

Go to the source code of this file.