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 * todo: not great that it's a global variable which we have to clean, move to 'engine' somewhere?
81 */
83#if EFI_ACTIVE_CONFIGURATION_IN_FLASH
84#include "flash_int.h"
85engine_configuration_s & activeConfiguration = reinterpret_cast<persistent_config_container_s*>(getFlashAddrFirstCopy())->persistentConfiguration.engineConfiguration;
86// we cannot use this activeConfiguration until we call rememberCurrentConfiguration()
88#else
91#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
92
94#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
96#else
98#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
100}
101
102static void fillAfterString(char *string, int size) {
103 // we have to reset bytes after \0 symbol in order to calculate correct tune CRC from MSQ file
104 for (int i = std::strlen(string) + 1; i < size; i++) {
105 string[i] = 0;
106 }
107}
108
115
122
123/**
124 * this hook is about https://wiki.rusefi.com/Custom-Firmware and https://wiki.rusefi.com/Canned-Tune-Process
125 * todo: why two hooks? is one already dead?
126 */
128 // placeholder
129}
130
131void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) {
132 // placeholder
133}
134
135/**
136 * this is the top-level method which should be called in case of any changes to engine configuration
137 * online tuning of most values in the maps does not count as configuration change, but 'Burn' command does
138 *
139 * this method is NOT currently invoked on ECU start - actual user input has to happen!
140 * See 'preCalculate' or 'startHardware' which are invoked BOTH on start and configuration change
141 */
144 assertStackVoid("increment", ObdCode::STACK_USAGE_MISC, EXPECTED_REMAINING_STACK);
146 criticalError("too early to invoke incrementGlobalConfigurationVersion %s", msg);
147 }
149#if EFI_DETAILED_LOGGING
150 efiPrintf("set globalConfigurationVersion=%d", globalConfigurationVersion);
151#endif /* EFI_DETAILED_LOGGING */
152
154
156
158
159#if EFI_ELECTRONIC_THROTTLE_BODY
161#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
162
163#if EFI_ENGINE_CONTROL && EFI_PROD_CODE
165#endif
166
167#if EFI_SHAFT_POSITION_INPUT
169#endif /* EFI_SHAFT_POSITION_INPUT */
170#if EFI_EMULATE_POSITION_SENSORS && ! EFI_UNIT_TEST
172#endif /* EFI_EMULATE_POSITION_SENSORS */
173
174 engine->engineModules.apply_all([](auto & m) {
175 m.onConfigurationChange(&activeConfiguration);
176 });
178}
179
180/**
181 * @brief Sets the same dwell time across the whole getRpm() range
182 * set dwell X
183 */
185 for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
186 config->sparkDwellRpmBins[i] = 1000 * i;
187 }
189}
190
191void setFuelTablesLoadBin(float minValue, float maxValue) {
192 setLinearCurve(config->injPhaseLoadBins, minValue, maxValue, 1);
193 setLinearCurve(config->veLoadBins, minValue, maxValue, 1);
194 setLinearCurve(config->lambdaLoadBins, minValue, maxValue, 1);
195}
196
197void setWholeIatCorrTimingTable(float value) {
199}
200
201/**
202 * See also crankingTimingAngle
203 */
206}
207
208#if EFI_ENGINE_CONTROL
209namespace {
210 void initTemperatureCurve(
211 float * const bins,
212 float * const values,
213 const int size,
214 const float defaultValue,
215 const float initialTemperature = -40.0f,
216 const float temperatureStep = 10.0f
217 ) {
218 for (int i = 0; i < size; i++) {
219 bins[i] = initialTemperature + i * temperatureStep;
220 values[i] = defaultValue; // this correction is a multiplier
221 }
222 }
223
224 void initBoostTemperatureCurve(float* const bins, float* const values, const float defaultValue) {
225 initTemperatureCurve(bins, values, BOOST_CURVE_SIZE, defaultValue, 20.0f, 20.0f);
226 }
227}
228#endif // EFI_ENGINE_CONTROL
229
231 criticalAssertVoid(p_engineConfiguration != nullptr, "ec NULL");
232 efi::clear(p_engineConfiguration);
233
234 p_engineConfiguration->clutchDownPinMode = PI_PULLUP;
235 p_engineConfiguration->clutchUpPinMode = PI_PULLUP;
236 p_engineConfiguration->brakePedalPinMode = PI_PULLUP;
237}
238
240#if EFI_PROD_CODE
241 // call overrided board-specific serial configuration setup, if needed (for custom boards only)
242 // needed also by bootloader code
244#endif /* EFI_PROD_CODE */
245
246 // set UART pads configuration based on the board
247// needed also by bootloader code
248#ifdef TS_SECONDARY_UxART_PORT
251#endif // TS_SECONDARY_UxART_PORT
252
255}
256
257// needed also by bootloader code
258// at the moment bootloader does NOT really need SD card, this is a step towards future bootloader SD card usage
262
263#if EFI_ENGINE_CONTROL
264
265/**
266 * see also setTargetRpmCurve()
267 */
269#if CLT_CURVE_SIZE == 16
270 copyArray(config->cltIdleRpmBins, { -30, - 20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 , 110, 120 });
271 copyArray(config->cltIdleRpm, { 1350, 1350, 1300, 1200, 1150, 1100, 1050, 1000, 1000, 950, 950, 930, 900, 900, 1000, 1100 });
272#endif // CLT_CURVE_SIZE
273}
274#endif // EFI_ENGINE_CONTROL
275
276/**
277 * see also setDefaultIdleSpeedTarget()
278 */
279void setTargetRpmCurve(float rpm) {
280 setLinearCurve(config->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10);
281 setLinearCurve(config->cltIdleRpm, rpm, rpm, 10);
282}
283
285 // Same config for all channels
286 for (size_t i = 0; i < efi::size(engineConfiguration->gppwm); i++) {
287 auto& cfg = engineConfiguration->gppwm[i];
288 chsnprintf(engineConfiguration->gpPwmNote[i], sizeof(engineConfiguration->gpPwmNote[0]), "GPPWM%d", i);
289
290 // Set default axes
291 cfg.loadAxis = GPPWM_Zero;
292 cfg.rpmAxis = GPPWM_Rpm;
293
294 cfg.pin = Gpio::Unassigned;
295 cfg.dutyIfError = 0;
296 cfg.onAboveDuty = 60;
297 cfg.offBelowDuty = 50;
298 cfg.pwmFrequency = 250;
299
300 for (size_t j = 0; j < efi::size(cfg.loadBins); j++) {
301 uint8_t z = j * 100 / (efi::size(cfg.loadBins) - 1);
302 cfg.loadBins[j] = z;
303
304 // Fill some values in the table
305 for (size_t k = 0; k < efi::size(cfg.rpmBins); k++) {
306 cfg.table[j][k] = z;
307 }
308
309 }
310
311 for (size_t j = 0; j < efi::size(cfg.rpmBins); j++) {
312 cfg.rpmBins[j] = 1000 * j;
313 }
314 }
315}
316
320
321#if EFI_ENGINE_CONTROL
330#endif // EFI_ENGINE_CONTROL
331
333 // OBD-II default rate is 500kbps
336#if (EFI_CAN_BUS_COUNT >= 3)
338#endif
339
344
345 // Don't enable, but set default address
346 engineConfiguration->verboseCanBaseAddress = CAN_DEFAULT_BASE;
347}
348
359
362 setLinearCurve(config->cltIdleCorrBins, CLT_CURVE_RANGE_FROM, 140, 10);
363 for (size_t i = 0; i < CLT_IDLE_TABLE_RPM_SIZE; i++) {
364 setLinearCurve(config->cltIdleCorrTable[i], 75.0, 50, 5);
365 }
366}
367
368/**
369 * @brief Global default engine configuration
370 * This method sets the global engine configuration defaults. These default values are then
371 * overridden by engine-specific defaults and the settings are saved in flash memory.
372 *
373 * This method is invoked only when new configuration is needed:
374 * * recently re-flashed chip
375 * * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION
376 * * 'rewriteconfig' command
377 * * 'set engine_type X' command
378 *
379 * This method should only change the state of the configuration data structure but should NOT change the state of
380 * anything else.
381 *
382 * This method should NOT be setting any default pinout
383 */
385#if (! EFI_UNIT_TEST)
387#endif
389
390#if EFI_BOOST_CONTROL
392#endif
393
395
397
401
402#if EFI_ENGINE_CONTROL
407
408 // VVT closed loop, totally random values!
415
416 engineConfiguration->vvtOutputFrequency = DEFAULT_SOLENOID_FREQUENCY; // VVT solenoid control
417
419
424
426
427#if EFI_IDLE_CONTROL
429#endif /* EFI_IDLE_CONTROL */
430
431#if EFI_ELECTRONIC_THROTTLE_BODY
434#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
435
437
440
442
446
447 initTemperatureCurve(IAT_FUEL_CORRECTION_CURVE, 1);
448
449 initBoostTemperatureCurve(config->cltBoostCorrBins, config->cltBoostCorr, 1.0f);
450 initBoostTemperatureCurve(config->iatBoostCorrBins, config->iatBoostCorr, 1.0f);
451 initBoostTemperatureCurve(config->cltBoostAdderBins, config->cltBoostAdder, 0.0f);
452 initBoostTemperatureCurve(config->iatBoostAdderBins, config->iatBoostAdder, 0.0f);
453
456
459
460 setLinearCurve(config->scriptCurve2Bins, 0, 100, /*precision*/1);
461 setLinearCurve(config->scriptCurve2, 30, 170, 1);
462
467
468 setLinearCurve(config->alsIgnRetardLoadBins, 2, 10, /*precision*/1);
470 setLinearCurve(config->alsFuelAdjustmentLoadBins, 2, 10, /*precision*/1);
473
474
479
480#if VVT_TABLE_SIZE == 8
483#else
486#endif
489
491
492 // is this same old setCommonNTCSensor?
493 engineConfiguration->clt.config = {0, 23.8889, 48.8889, 9500, 2100, 1000, 1500};
494
496
497 // wow unit tests have much cooler setDefaultLaunchParameters method
499// engineConfiguration->launchTimingRetard = 10;
502
504
505 /**
506 * Idle control defaults
507 */
509 // setTargetRpmCurve(1200);
510
513
516 /**
517 * between variation between different sensor and weather and fabrication tolerance
518 * five percent looks like a safer default
519 */
521
522 engineConfiguration->idle.solenoidFrequency = DEFAULT_SOLENOID_FREQUENCY;
523 // set idle_position 50
525// engineConfiguration->idleMode = IM_AUTO;
527
529
531
532#if !EFI_UNIT_TEST
533 // todo: remove from *engine* defaults, move into boards?
535#endif
536
537
542
547
548 engineConfiguration->idlePositionMin = PACK_MULT_VOLTAGE * 0;
549 engineConfiguration->idlePositionMax = PACK_MULT_VOLTAGE * 5;
554
558 engineConfiguration->oilPressure.value2 = 689.476f; // 100psi = 689.476kPa
559
561 // todo: start using this for custom MAP
563
565
567
568 setEgoSensor(ES_14Point7_Free);
569
570 // todo: remove from *engine* defaults, move into boards?
572
573 engineConfiguration->map.sensor.type = MT_MPX4250;
574
578
579#if EFI_PROD_CODE
581#else
582 // need more events for automated test
584#endif
585
586#if EFI_PROD_CODE || EFI_SIMULATOR
587 // some tests broke with map averaging, see https://github.com/rusefi/rusefi/issues/7868
589#endif
591
598
605
606 engineConfiguration->triggerSimulatorRpm = DEFAULT_SELT_STIM_RPM;
607 engineConfiguration->simulatorCamPosition[0] = DEFAULT_SELT_STIM_VVT0;
608
609 engineConfiguration->alternatorPwmFrequency = DEFAULT_SOLENOID_FREQUENCY;
610
612
617
619 // todo: default limits should be hard-coded for each sensor type
620 // https://github.com/rusefi/rusefi/issues/4030
622
624#endif // EFI_ENGINE_CONTROL
625 // Allow custom default_script.lua to be provided by BOARDINC
626 // see https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC6
627 #include <default_script.lua>
628}
629
630#if defined(STM32F7) && defined(HARDWARE_CI)
631// part of F7 drama looks like we are having a hard time erasing configuration on HW CI :(
632#define IGNORE_FLASH_CONFIGURATION true
633#endif
634
635// by default, do not ignore config from flash! use it!
636#ifndef IGNORE_FLASH_CONFIGURATION
637#define IGNORE_FLASH_CONFIGURATION false
638#endif
639
641
642#if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH
643 // Clear the active configuration so that registered output pins (etc) detect the change on startup and init properly
645#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
646
647 /* If board have any storage */
648#if EFI_CONFIGURATION_STORAGE
649 if (IGNORE_FLASH_CONFIGURATION) {
650 engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
653 } else {
654 // this call reads configuration from flash memory or sets default configuration
655 // if flash state does not look right.
657 }
658#else
659 // This board doesn't load configuration, initialize the default
660 engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
662#endif /* EFI_CONFIGURATION_STORAGE */
663
664 // Force any board configuration options that humans shouldn't be able to change
666}
667
669 enginePins.reset(); // that's mostly important for functional tests
670 /**
671 * Let's apply global defaults first
672 */
674
675 /**
676 * custom board engine defaults. Yes, this overlaps with (older) engine_type_e approach.
677 */
679
680 // set initial pin groups
682
683 if (boardCallback != nullptr) {
684 boardCallback(engineConfiguration);
685 }
686
687#if EFI_PROD_CODE
688 // call board-specific configuration setup, if needed (for custom boards only)
691#endif // EFI_PROD_CODE
692
693 engineConfiguration->engineType = engineType;
694 applyEngineType(engineType);
696}
697
699 UNUSED(p_engineConfiguration);
700}
701
705
707#if EFI_PROD_CODE
708 efiAssertVoid(ObdCode::CUSTOM_APPLY_STACK, hasLotsOfRemainingStack(), "apply c");
709 efiPrintf("applyNonPersistentConfiguration()");
710#endif
711
712#if EFI_ENGINE_CONTROL
714#endif // EFI_ENGINE_CONTROL
715}
716
720
722 // this is related to 'setDefaultBaseEngine' having 'skippedWheelOnCam = true' which is a weird fact by itself
724}
725
727 /**
728 * VBatt
729 */
731}
732
734 // custom_board_DefaultConfiguration
735}
737 // time to force migration to custom_board_ConfigOverrides
738}
739
740PUBLIC_API_WEAK int hackHellenBoardId(int detectedId) { return detectedId; }
741
742PUBLIC_API_WEAK void onBoardStandBy() { }
743
744PUBLIC_API_WEAK_SOMETHING_WEIRD int getBoardMetaOutputsCount() { return 0; }
745// default implementation: treat all outputs as low side
747PUBLIC_API_WEAK Gpio* getBoardMetaOutputs() { return nullptr; }
748PUBLIC_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)
std::optional< setup_custom_board_overrides_type > custom_board_BeforeTuneDefaults
Definition hardware.cpp:79
void setDefaultBoostParameters()
void setPinConfigurationOverrides()
void preCalculate()
Definition engine.cpp:333
int globalConfigurationVersion
Definition engine.h:323
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:198
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:415
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)
void boardOnConfigurationChange(engine_configuration_s *)
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 int hackHellenBoardId(int detectedId)
bool hasRememberedConfiguration
void boardBeforeTuneDefaults()
void rememberCurrentConfiguration()
void setBoardConfigOverrides()
void applyNonPersistentConfiguration()
static void fillAfterString(char *string, int size)
void setWholeTimingTable(angle_t value)
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:253
void readFromFlash()
void writeToFlashNow()
void applyNewHardwareSettings()
Definition hardware.cpp:314
Idle Valve Control thread.
void setDefaultIdleParameters()
UNUSED(samplingTimeSeconds)
void setBosch0280218037()
Definition maf.cpp:25
@ STACK_USAGE_MISC
@ CUSTOM_APPLY_STACK
float floatms_t
char[VIN_NUMBER_SIZE] vin_number_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< int16_t, 10, 1 > ignitionIatCorrTable[IAT_IGN_CORR_LOAD_COUNT][IAT_IGN_CORR_TEMP_COUNT]
scaled_channel< uint8_t, 1, 100 > rpmIdleCorrBins[CLT_IDLE_TABLE_RPM_SIZE]
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)