rusEFI
The most advanced open source ECU
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. More...
 
efitimesec_t getTimeNowS ()
 Current system time in seconds (32 bits) More...
 

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(), slowStartStopButtonCallback(), 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::checkOutput(), comp_cam_callback(), comp_shaft_callback(), configureRusefiLuaHooks(), detectHellenBoardId(), endIntegration(), endSimultaneousInjectionOnlyTogglePins(), TriggerCentral::engineMovedRecently(), EngineState::EngineState(), SingleTimerExecutor::executeAllPendingActions(), EventQueue::executeOne(), fireSparkAndPrepareNextSchedule(), StoredValueSensor::get(), getAcrState(), EtbController::getClosedLoopAutotune(), VvtController::getSetpoint(), getTimeNowUs(), PwmConfig::handleCycleStart(), TriggerEmulatorHelper::handleEmulatorCallback(), handleExtiIsr(), initMicrosecondTimer(), Engine::isInShutdownMode(), WaveChart::isStartedTooLongAgo(), HellenBoardIdFinder< NumPins >::measureChargingTimes(), onFastAdcComplete(), LimpManager::onFastCallback(), PrimeController::onIgnitionStateChanged(), PrimeController::onPrimeStart(), RpmCalculator::onSlowCallback(), onStartKnockSampling(), onTdcCallback(), EngineState::periodicFastCallback(), Engine::resetEngineSnifferIfInTestMode(), runBench(), runOneLua(), SingleTimerExecutor::scheduleByTimestampNt(), SingleTimerExecutor::scheduleTimerCallback(), 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(), and EngineState::updateTChargeK().

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 TriggerDecoderBase::decodeTriggerEvent(), AcController::getAcState(), handleTestCommand(), Engine::periodicSlowCallback(), printRusefiVersion(), sendQcBenchBoardStatus(), THD_FUNCTION(), 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().

Go to the source code of this file.