rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
engine_configuration.cpp
Go to the documentation of this file.
1/**
2 * @file engine_configuration.cpp
3 * @brief Utility method related to the engine configuration data structure.
4 *
5 * @date Nov 22, 2013
6 * @author Andrey Belomutskiy, (c) 2012-2020
7 *
8 * This file is part of rusEfi - see http://rusefi.com
9 *
10 * rusEfi is free software; you can redistribute it and/or modify it under the terms of
11 * the GNU General Public License as published by the Free Software Foundation; either
12 * version 3 of the License, or (at your option) any later version.
13 *
14 * rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
15 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along with this program.
19 * If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include "pch.h"
24#include "transition_events.h"
25#include "speed_density.h"
26#include "flash_main.h"
27
28#include "bench_test.h"
29
30#if EFI_ONBOARD_MEMS
31#include "accelerometer.h"
32#endif // EFI_ONBOARD_MEMS
33
34#include "defaults.h"
35
36#include "custom_engine.h"
37
38#include "boost_control.h"
40#if EFI_IDLE_CONTROL
41#include "idle_thread.h"
42#endif /* EFI_IDLE_CONTROL */
43
44#if EFI_ALTERNATOR_CONTROL
46#endif
47
48#if EFI_ELECTRONIC_THROTTLE_BODY
49#include "electronic_throttle.h"
50#endif
51
52#include "hardware.h"
53
54#if EFI_PROD_CODE
55#include "board.h"
56#endif /* EFI_PROD_CODE */
57
58#if EFI_EMULATE_POSITION_SENSORS
60#endif /* EFI_EMULATE_POSITION_SENSORS */
61
62#if EFI_TUNER_STUDIO
63#include "tunerstudio.h"
64#endif
65
66#include "board_overrides.h"
67
68#define TS_DEFAULT_SPEED 38400
69
70std::optional<setup_custom_board_overrides_type> custom_board_DefaultConfiguration;
71std::optional<setup_custom_board_overrides_type> custom_board_ConfigOverrides;
72std::optional<setup_custom_board_config_type> custom_board_OnConfigurationChange;
73
74/**
75 * Current engine configuration. On firmware start we assign empty configuration, then
76 * we copy actual configuration after reading settings from flash.
77 * This is useful to compare old/current (activeConfiguration) and new/future (engineConfiguration) configurations in order to apply new settings.
78 *
79 * todo: place this field next to 'engineConfiguration'?
80 */
81static bool hasRememberedConfiguration = false;
82#if EFI_ACTIVE_CONFIGURATION_IN_FLASH
83#include "flash_int.h"
84engine_configuration_s & activeConfiguration = reinterpret_cast<persistent_config_container_s*>(getFlashAddrFirstCopy())->persistentConfiguration.engineConfiguration;
85// we cannot use this activeConfiguration until we call rememberCurrentConfiguration()
87#else
90#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
91
93#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
95#else
97#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
99}
100
101static void fillAfterString(char *string, int size) {
102 // we have to reset bytes after \0 symbol in order to calculate correct tune CRC from MSQ file
103 for (int i = std::strlen(string) + 1; i < size; i++) {
104 string[i] = 0;
105 }
106}
107
113
120
121/**
122 * this hook is about https://github.com/rusefi/rusefi/wiki/Custom-Firmware and https://github.com/rusefi/rusefi/wiki/Canned-Tune-Process
123 * todo: why two hooks? is one already dead?
124 */
125PUBLIC_API_WEAK void boardBeforeTuneDefaults() { }
126
127// Weak link a stub so that every board doesn't have to implement this function
128PUBLIC_API_WEAK void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) { }
129
130/**
131 * this is the top-level method which should be called in case of any changes to engine configuration
132 * online tuning of most values in the maps does not count as configuration change, but 'Burn' command does
133 *
134 * this method is NOT currently invoked on ECU start - actual user input has to happen!
135 * See 'preCalculate' or 'startHardware' which are invoked BOTH on start and configuration change
136 */
139 assertStackVoid("increment", ObdCode::STACK_USAGE_MISC, EXPECTED_REMAINING_STACK);
141 criticalError("too early to invoke incrementGlobalConfigurationVersion %s", msg);
142 }
144#if EFI_DETAILED_LOGGING
145 efiPrintf("set globalConfigurationVersion=%d", globalConfigurationVersion);
146#endif /* EFI_DETAILED_LOGGING */
147
149
152
154
155#if EFI_ELECTRONIC_THROTTLE_BODY
157#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
158
159#if EFI_ENGINE_CONTROL && EFI_PROD_CODE
161#endif
162
163#if EFI_SHAFT_POSITION_INPUT
165#endif /* EFI_SHAFT_POSITION_INPUT */
166#if EFI_EMULATE_POSITION_SENSORS && ! EFI_UNIT_TEST
168#endif /* EFI_EMULATE_POSITION_SENSORS */
169
170 engine->engineModules.apply_all([](auto & m) {
171 m.onConfigurationChange(&activeConfiguration);
172 });
174}
175
176/**
177 * @brief Sets the same dwell time across the whole getRpm() range
178 * set dwell X
179 */
181 for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
182 config->sparkDwellRpmBins[i] = 1000 * i;
183 }
185}
186
187void setFuelTablesLoadBin(float minValue, float maxValue) {
188 setLinearCurve(config->injPhaseLoadBins, minValue, maxValue, 1);
189 setLinearCurve(config->veLoadBins, minValue, maxValue, 1);
190 setLinearCurve(config->lambdaLoadBins, minValue, maxValue, 1);
191}
192
193void setWholeIatCorrTimingTable(float value) {
195}
196
197/**
198 * See also crankingTimingAngle
199 */
202}
203
204#if EFI_ENGINE_CONTROL
205namespace {
206 void initTemperatureCurve(
207 float * const bins,
208 float * const values,
209 const int size,
210 const float defaultValue,
211 const float initialTemperature = -40.0f,
212 const float temperatureStep = 10.0f
213 ) {
214 for (int i = 0; i < size; i++) {
215 bins[i] = initialTemperature + i * temperatureStep;
216 values[i] = defaultValue; // this correction is a multiplier
217 }
218 }
219
220 void initBoostTemperatureCurve(float* const bins, float* const values, const float defaultValue) {
221 initTemperatureCurve(bins, values, BOOST_CURVE_SIZE, defaultValue, 20.0f, 20.0f);
222 }
223}
224#endif // EFI_ENGINE_CONTROL
225
227 criticalAssertVoid(p_engineConfiguration != nullptr, "ec NULL");
228 efi::clear(p_engineConfiguration);
229
230 p_engineConfiguration->clutchDownPinMode = PI_PULLUP;
231 p_engineConfiguration->clutchUpPinMode = PI_PULLUP;
232 p_engineConfiguration->brakePedalPinMode = PI_PULLUP;
233}
234
236#if EFI_PROD_CODE
237 // call overrided board-specific serial configuration setup, if needed (for custom boards only)
238 // needed also by bootloader code
240#endif /* EFI_PROD_CODE */
241
242 // set UART pads configuration based on the board
243// needed also by bootloader code
244#ifdef TS_SECONDARY_UxART_PORT
247#endif // TS_SECONDARY_UxART_PORT
248
251}
252
253// needed also by bootloader code
254// at the moment bootloader does NOT really need SD card, this is a step towards future bootloader SD card usage
258
259#if EFI_ENGINE_CONTROL
260
261/**
262 * see also setTargetRpmCurve()
263 */
265#if CLT_CURVE_SIZE == 16
266 copyArray(config->cltIdleRpmBins, { -30, - 20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 , 110, 120 });
267 copyArray(config->cltIdleRpm, { 1350, 1350, 1300, 1200, 1150, 1100, 1050, 1000, 1000, 950, 950, 930, 900, 900, 1000, 1100 });
268#endif // CLT_CURVE_SIZE
269}
270#endif // EFI_ENGINE_CONTROL
271
272/**
273 * see also setDefaultIdleSpeedTarget()
274 */
275void setTargetRpmCurve(float rpm) {
276 setLinearCurve(config->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10);
277 setLinearCurve(config->cltIdleRpm, rpm, rpm, 10);
278}
279
281 // Same config for all channels
282 for (size_t i = 0; i < efi::size(engineConfiguration->gppwm); i++) {
283 auto& cfg = engineConfiguration->gppwm[i];
284 chsnprintf(engineConfiguration->gpPwmNote[i], sizeof(engineConfiguration->gpPwmNote[0]), "GPPWM%d", i);
285
286 // Set default axes
287 cfg.loadAxis = GPPWM_Zero;
288 cfg.rpmAxis = GPPWM_Rpm;
289
290 cfg.pin = Gpio::Unassigned;
291 cfg.dutyIfError = 0;
292 cfg.onAboveDuty = 60;
293 cfg.offBelowDuty = 50;
294 cfg.pwmFrequency = 250;
295
296 for (size_t j = 0; j < efi::size(cfg.loadBins); j++) {
297 uint8_t z = j * 100 / (efi::size(cfg.loadBins) - 1);
298 cfg.loadBins[j] = z;
299
300 // Fill some values in the table
301 for (size_t k = 0; k < efi::size(cfg.rpmBins); k++) {
302 cfg.table[j][k] = z;
303 }
304
305 }
306
307 for (size_t j = 0; j < efi::size(cfg.rpmBins); j++) {
308 cfg.rpmBins[j] = 1000 * j;
309 }
310 }
311}
312
316
317#if EFI_ENGINE_CONTROL
326#endif // EFI_ENGINE_CONTROL
327
329 // OBD-II default rate is 500kbps
332#if (EFI_CAN_BUS_COUNT >= 3)
334#endif
335
340
341 // Don't enable, but set default address
342 engineConfiguration->verboseCanBaseAddress = CAN_DEFAULT_BASE;
343}
344
355
358 setLinearCurve(config->cltIdleCorrBins, CLT_CURVE_RANGE_FROM, 140, 10);
359 for (size_t i = 0; i < CLT_IDLE_TABLE_RPM_SIZE; i++) {
360 setLinearCurve(config->cltIdleCorrTable[i], 75.0, 50, 5);
361 }
362}
363
364/**
365 * @brief Global default engine configuration
366 * This method sets the global engine configuration defaults. These default values are then
367 * overridden by engine-specific defaults and the settings are saved in flash memory.
368 *
369 * This method is invoked only when new configuration is needed:
370 * * recently re-flashed chip
371 * * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION
372 * * 'rewriteconfig' command
373 * * 'set engine_type X' command
374 *
375 * This method should only change the state of the configuration data structure but should NOT change the state of
376 * anything else.
377 *
378 * This method should NOT be setting any default pinout
379 */
381#if (! EFI_UNIT_TEST)
383#endif
385
386#if EFI_BOOST_CONTROL
388#endif
389
391
393
397
398#if EFI_ENGINE_CONTROL
403
404 // VVT closed loop, totally random values!
411
412 engineConfiguration->vvtOutputFrequency = DEFAULT_SOLENOID_FREQUENCY; // VVT solenoid control
413
415
420
422
423#if EFI_IDLE_CONTROL
425#endif /* EFI_IDLE_CONTROL */
426
427#if EFI_ELECTRONIC_THROTTLE_BODY
430#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
431
433
436
438
442
443 initTemperatureCurve(IAT_FUEL_CORRECTION_CURVE, 1);
444
445 initBoostTemperatureCurve(config->cltBoostCorrBins, config->cltBoostCorr, 1.0f);
446 initBoostTemperatureCurve(config->iatBoostCorrBins, config->iatBoostCorr, 1.0f);
447 initBoostTemperatureCurve(config->cltBoostAdderBins, config->cltBoostAdder, 0.0f);
448 initBoostTemperatureCurve(config->iatBoostAdderBins, config->iatBoostAdder, 0.0f);
449
452
455
456 setLinearCurve(config->scriptCurve2Bins, 0, 100, /*precision*/1);
457 setLinearCurve(config->scriptCurve2, 30, 170, 1);
458
463
464 setLinearCurve(config->alsIgnRetardLoadBins, 2, 10, /*precision*/1);
466 setLinearCurve(config->alsFuelAdjustmentLoadBins, 2, 10, /*precision*/1);
469
470
475
476#if VVT_TABLE_SIZE == 8
479#else
482#endif
485
487
488 // is this same old setCommonNTCSensor?
489 engineConfiguration->clt.config = {0, 23.8889, 48.8889, 9500, 2100, 1000, 1500};
490
492
493 // wow unit tests have much cooler setDefaultLaunchParameters method
495// engineConfiguration->launchTimingRetard = 10;
498
500
501 /**
502 * Idle control defaults
503 */
505 // setTargetRpmCurve(1200);
506
509
512 /**
513 * between variation between different sensor and weather and fabrication tolerance
514 * five percent looks like a safer default
515 */
517
518 engineConfiguration->idle.solenoidFrequency = DEFAULT_SOLENOID_FREQUENCY;
519 // set idle_position 50
521// engineConfiguration->idleMode = IM_AUTO;
523
525
527
528#if !EFI_UNIT_TEST
530#endif
531
532
537
542
543 engineConfiguration->idlePositionMin = PACK_MULT_VOLTAGE * 0;
544 engineConfiguration->idlePositionMax = PACK_MULT_VOLTAGE * 5;
549
553 engineConfiguration->oilPressure.value2 = 689.476f; // 100psi = 689.476kPa
554
556 // todo: start using this for custom MAP
558
560
562
563 setEgoSensor(ES_14Point7_Free);
564
566
567 engineConfiguration->map.sensor.type = MT_MPX4250;
568
572
573#if EFI_PROD_CODE
575#else
576 // need more events for automated test
578#endif
579
580#if EFI_PROD_CODE || EFI_SIMULATOR
581 // some tests broke with map averaging, see https://github.com/rusefi/rusefi/issues/7868
583#endif
585
592
599
600 engineConfiguration->triggerSimulatorRpm = DEFAULT_SELT_STIM_RPM;
601 engineConfiguration->simulatorCamPosition[0] = DEFAULT_SELT_STIM_VVT0;
602
603 engineConfiguration->alternatorPwmFrequency = DEFAULT_SOLENOID_FREQUENCY;
604
606
611
613 // todo: default limits should be hard-coded for each sensor type
614 // https://github.com/rusefi/rusefi/issues/4030
616
618#endif // EFI_ENGINE_CONTROL
619 #include "default_script.lua"
620}
621
622#if defined(STM32F7) && defined(HARDWARE_CI)
623// part of F7 drama looks like we are having a hard time erasing configuration on HW CI :(
624#define IGNORE_FLASH_CONFIGURATION true
625#endif
626
627// by default, do not ignore config from flash! use it!
628#ifndef IGNORE_FLASH_CONFIGURATION
629#define IGNORE_FLASH_CONFIGURATION false
630#endif
631
633
634#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
635 // Clear the active configuration so that registered output pins (etc) detect the change on startup and init properly
637#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
638
639 /* If board have any storage */
640#if EFI_CONFIGURATION_STORAGE
641 if (IGNORE_FLASH_CONFIGURATION) {
642 engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
645 } else {
646 // this call reads configuration from flash memory or sets default configuration
647 // if flash state does not look right.
649 }
650#else
651 // This board doesn't load configuration, initialize the default
652 engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
654#endif /* EFI_CONFIGURATION_STORAGE */
655
656 // Force any board configuration options that humans shouldn't be able to change
658}
659
661 enginePins.reset(); // that's mostly important for functional tests
662 /**
663 * Let's apply global defaults first
664 */
666
667 /**
668 * custom board engine defaults. Yes, this overlaps with (older) engine_type_e approach.
669 */
671
672 // set initial pin groups
674
675 if (boardCallback != nullptr) {
676 boardCallback(engineConfiguration);
677 }
678
679#if EFI_PROD_CODE
680 // call board-specific configuration setup, if needed (for custom boards only)
683#endif // EFI_PROD_CODE
684
685 engineConfiguration->engineType = engineType;
686 applyEngineType(engineType);
688}
689
691 UNUSED(p_engineConfiguration);
692}
693
697
699#if EFI_PROD_CODE
700 efiAssertVoid(ObdCode::CUSTOM_APPLY_STACK, hasLotsOfRemainingStack(), "apply c");
701 efiPrintf("applyNonPersistentConfiguration()");
702#endif
703
704#if EFI_ENGINE_CONTROL
706#endif // EFI_ENGINE_CONTROL
707}
708
712
714 // this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
716}
717
719 /**
720 * VBatt
721 */
723}
724
726 // custom_board_DefaultConfiguration
727}
729 // time to force migration to custom_board_ConfigOverrides
730}
731
732PUBLIC_API_WEAK int hackHellenBoardId(int detectedId) { return detectedId; }
733
734PUBLIC_API_WEAK void onBoardStandBy() { }
735
736PUBLIC_API_WEAK_SOMETHING_WEIRD int getBoardMetaOutputsCount() { return 0; }
737// default implementation: treat all outputs as low side
739PUBLIC_API_WEAK Gpio* getBoardMetaOutputs() { return nullptr; }
740PUBLIC_API_WEAK int getBoardMetaDcOutputsCount() { return 0; }
alternator controller
void onConfigurationChangeBenchTest()
Utility methods related to bench testing.
static bool call_board_override(std::optional< FuncType > board_override, Args &&... args)
void setDefaultBoostParameters()
void setPinConfigurationOverrides()
void preCalculate()
Definition engine.cpp:324
int globalConfigurationVersion
Definition engine.h:315
void updateTriggerConfiguration()
Definition engine.cpp:133
type_list< Mockable< InjectorModelPrimary >, Mockable< InjectorModelSecondary >,#if EFI_IDLE_CONTROL Mockable< IdleController >,#endif TriggerScheduler,#if EFI_HPFP &&EFI_ENGINE_CONTROL Mockable< HpfpController >,#endif #if EFI_ENGINE_CONTROL Mockable< ThrottleModel >,#endif #if EFI_ALTERNATOR_CONTROL AlternatorController,#endif MainRelayController, Mockable< IgnitionController >, Mockable< AcController >, PrimeController, DfcoController,#if EFI_HD_ACR HarleyAcr,#endif Mockable< WallFuelController >, KnockController, SensorChecker,#if EFI_ENGINE_CONTROL Mockable< LimpManager >,#endif #if EFI_VVT_PID VvtController1, VvtController2, VvtController3, VvtController4,#endif #if EFI_BOOST_CONTROL BoostController,#endif TpsAccelEnrichment,#if EFI_LAUNCH_CONTROL NitrousController,#endif #if EFI_LTFT_CONTROL LongTermFuelTrim,#endif ShortTermFuelTrim,#include "modules_list_generated.h" EngineModule > engineModules
Definition engine.h:194
void reset()
Definition efi_gpio.cpp:275
@ Unassigned
void setBoschHDEV_5_injectors()
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)
void setDefaultBaseEngine()
void setDefaultCranking()
void setDefaultFuel()
void setDefaultIgnition()
EnginePins enginePins
Definition efi_gpio.cpp:24
void setEgoSensor(ego_sensor_e type)
Definition ego.cpp:100
void setDefaultEtbParameters()
void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration)
void setDefaultEtbBiasCurve()
static EngineAccessor engine
Definition engine.h:413
void setConstantDwell(floatms_t dwellMs)
Sets the same dwell time across the whole getRpm() range set dwell X.
PUBLIC_API_WEAK_SOMETHING_WEIRD int getBoardMetaOutputsCount()
static void setDefaultEngineConfiguration()
Global default engine configuration This method sets the global engine configuration defaults....
void setBoardDefaultConfiguration()
Board-specific configuration defaults.
void emptyCallbackWithConfiguration(engine_configuration_s *p_engineConfiguration)
static void setDefaultBoostOpenLoopParameters()
void onBurnRequest()
static void setDefaultGppwmParameters()
void setCamOperationMode()
void commonFrankensoAnalogInputs()
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
void setDefaultBasePins()
static void setDefaultIdleOpenLoopParameters()
PUBLIC_API_WEAK int getBoardMetaDcOutputsCount()
PUBLIC_API_WEAK Gpio * getBoardMetaOutputs()
void incrementGlobalConfigurationVersion(const char *msg)
static void setDefaultScriptParameters()
PUBLIC_API_WEAK void onBoardStandBy()
void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType)
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
void setTargetRpmCurve(float rpm)
void setDefaultSdCardParameters()
void setCrankOperationMode()
static engine_configuration_s activeConfigurationLocalStorage
void loadConfiguration()
static void setDefaultEngineNoiseTable()
void setWholeIatCorrTimingTable(float value)
PUBLIC_API_WEAK void boardBeforeTuneDefaults()
PUBLIC_API_WEAK int hackHellenBoardId(int detectedId)
static bool hasRememberedConfiguration
void rememberCurrentConfiguration()
void setBoardConfigOverrides()
void applyNonPersistentConfiguration()
static void fillAfterString(char *string, int size)
void setWholeTimingTable(angle_t value)
PUBLIC_API_WEAK void boardOnConfigurationChange(engine_configuration_s *)
static void wipeStrings()
std::optional< setup_custom_board_config_type > custom_board_OnConfigurationChange
static void setDefaultIdleSpeedTarget()
void prepareVoidConfiguration(engine_configuration_s *p_engineConfiguration)
bool isActiveConfigurationVoid
void setFuelTablesLoadBin(float minValue, float maxValue)
static void setDefaultCanSettings()
engine_configuration_s & activeConfiguration
PUBLIC_API_WEAK int getBoardMetaLowSideOutputsCount()
static constexpr persistent_config_s * config
void applyEngineType(engine_type_e engineType)
void(* configuration_callback_t)(engine_configuration_s *)
static constexpr engine_configuration_s * engineConfiguration
persistent_config_container_s persistentState
engine_type_e
uintptr_t getFlashAddrFirstCopy(void)
Definition mpu_util.cpp:248
void readFromFlash()
void writeToFlashNow()
void applyNewHardwareSettings()
Definition hardware.cpp:311
Idle Valve Control thread.
void setDefaultIdleParameters()
UNUSED(samplingTimeSeconds)
void setBosch0280218037()
Definition maf.cpp:25
@ STACK_USAGE_MISC
@ CUSTOM_APPLY_STACK
float floatms_t
float angle_t
char[VEHICLE_INFO_SIZE] vehicle_info_t
float cltIdleCorrTable[CLT_IDLE_TABLE_RPM_SIZE][CLT_IDLE_TABLE_CLT_SIZE]
scaled_channel< int16_t, 1, 1 > cltIdleRpmBins[CLT_CURVE_SIZE]
scaled_channel< uint8_t, 1, 100 > iacCoastingRpmBins[CLT_CURVE_SIZE]
scaled_channel< int8_t, 2, 1 > knockBaseNoise[ENGINE_NOISE_CURVE_SIZE]
scaled_channel< uint16_t, 1000, 1 > fuelLevelBins[FUEL_LEVEL_TABLE_COUNT]
scaled_channel< uint16_t, 10, 1 > throttleEstimateEffectiveAreaBins[THR_EST_SIZE]
scaled_channel< uint8_t, 1, 100 > rpmIdleCorrBins[CLT_IDLE_TABLE_RPM_SIZE]
scaled_channel< int16_t, 10, 1 > ignitionIatCorrTable[IAT_IGN_CORR_LOAD_COUNT][IAT_IGN_CORR_COUNT]
scaled_channel< int16_t, 10, 1 > ignitionTable[IGN_LOAD_COUNT][IGN_RPM_COUNT]
scaled_channel< uint8_t, 1, 20 > cltIdleRpm[CLT_CURVE_SIZE]
scaled_channel< uint16_t, 100, 1 > sparkDwellValues[DWELL_CURVE_SIZE]
constexpr void setTable(TElement(&dest)[N][M], const VElement value)
void setRpmTableBin(TValue(&array)[TSize])
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)
void setArrayValues(TValue(&array)[TSize], float value)
void setCommonNTCSensorParameters(ThermistorConf *thermistorConf)
composite packet size
constexpr int convertVoltageTo10bitADC(float voltage)
Definition tps.h:21
void onTransitionEvent(TransitionEvent event)
void onConfigurationChangeTriggerCallback()
void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration)