refactoring: extracting constant

This commit is contained in:
rusefi 2019-06-11 21:44:16 -04:00
parent 6b7baaaecc
commit 8406be52f0
4 changed files with 6 additions and 3 deletions

View File

@ -333,7 +333,7 @@ void setEtbOffset(int value) {
void setDefaultEtbParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
setLinearCurveAny<int8_t>(config->pedalToTpsPedalBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/100, 1);
setLinearCurveAny<uint8_t>(config->pedalToTpsRpmBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/8000 / 50, 1);
setLinearCurveAny<uint8_t>(config->pedalToTpsRpmBins, PEDAL_TO_TPS_SIZE, /*from*/0, /*to*/8000 / RPM_1_BYTE_PACKING_MULT, 1);
for (int pedalIndex = 0;pedalIndex<PEDAL_TO_TPS_SIZE;pedalIndex++) {
for (int rpmIndex = 0;rpmIndex<PEDAL_TO_TPS_SIZE;rpmIndex++) {

View File

@ -1496,6 +1496,7 @@
#define primeInjFalloffTemperature_offset_hex 5ce
#define primingSquirtDurationMs_offset 96
#define primingSquirtDurationMs_offset_hex 60
#define RPM_1_BYTE_PACKING_MULT 50
#define rpmHardLimit_offset 416
#define rpmHardLimit_offset_hex 1a0
#define runningLedPin_offset 1833

View File

@ -111,6 +111,7 @@ struct_no_prefix engine_configuration_s
#define FUEL_LOAD_COUNT 16
#define PEDAL_TO_TPS_SIZE 8
#define RPM_1_BYTE_PACKING_MULT 50
#define FSIO_TABLE_8 8
@ -1063,7 +1064,7 @@ engine_configuration_s engineConfiguration;
pedal_to_tps_t pedalToTpsTable;
int8_t[PEDAL_TO_TPS_SIZE] pedalToTpsPedalBins;;"%", 1, 0, 0.0, 120.0, 0
! it's not serious to use one byte for RPM but let me try that just to try it
uint8_t[PEDAL_TO_TPS_SIZE] pedalToTpsRpmBins;;"RPM", 50, 0, 0.0, 12000.0, 0
uint8_t[PEDAL_TO_TPS_SIZE] pedalToTpsRpmBins;;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0.0, 12000.0, 0
float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorrBins;CLT-based cranking position multiplier for simple manual idle controller;"C", 1, 0, -100.0, 250.0, 2
float[CLT_CRANKING_CURVE_SIZE] cltCrankingCorr ;CLT-based cranking position multiplier for simple manual idle controller;"%", 1, 0, 0.0, 500.0, 2

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 10 23:50:00 EDT 2019
// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Tue Jun 11 21:30:38 EDT 2019
public class Fields {
public static final int accelerometerSpiDevice_offset = 2736;
public static final int acCutoffHighRpm_offset = 1498;
@ -974,6 +974,7 @@ public class Fields {
public static final int primeInjFalloffTemperature_offset = 1486;
public static final int primingSquirtDurationMs_offset = 96;
public static final int primingSquirtDurationMs_offset_hex = 60;
public static final int RPM_1_BYTE_PACKING_MULT = 50;
public static final int rpmHardLimit_offset = 416;
public static final int runningLedPin_offset = 1833;
public static final int runningLedPin_offset_hex = 729;