From ae94f76163bcfe7d4127e682b1f137f0cd125a42 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 12 Mar 2024 15:52:24 -0400 Subject: [PATCH] higher precision scriptTable2 --- firmware/config/boards/kinetis/prepend.txt | 3 +++ firmware/controllers/lua/script_impl.cpp | 2 +- firmware/controllers/lua/script_impl.h | 1 + firmware/integration/rusefi_config.txt | 8 +++++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/firmware/config/boards/kinetis/prepend.txt b/firmware/config/boards/kinetis/prepend.txt index b4f7266944..59162da470 100644 --- a/firmware/config/boards/kinetis/prepend.txt +++ b/firmware/config/boards/kinetis/prepend.txt @@ -17,4 +17,7 @@ #define IGN_RPM_COUNT 8 #define IGN_LOAD_COUNT 8 +#define TABLE_2_RPM_SIZE 2 +#define TABLE_2_LOAD_SIZE 2 + #define FUEL_RPM_COUNT 8 diff --git a/firmware/controllers/lua/script_impl.cpp b/firmware/controllers/lua/script_impl.cpp index 8dd0f22d7b..23da1bca8b 100644 --- a/firmware/controllers/lua/script_impl.cpp +++ b/firmware/controllers/lua/script_impl.cpp @@ -13,7 +13,7 @@ #include "script_impl.h" static fsio8_Map3D_f32t scriptTable1; -static fsio8_Map3D_u8t scriptTable2; +static script2_Map3D_f32t scriptTable2; static fsio8_Map3D_u8t scriptTable3; static script4_Map3D_u8t scriptTable4; diff --git a/firmware/controllers/lua/script_impl.h b/firmware/controllers/lua/script_impl.h index f2ca1066bc..75d1c50f4f 100644 --- a/firmware/controllers/lua/script_impl.h +++ b/firmware/controllers/lua/script_impl.h @@ -10,6 +10,7 @@ #include typedef Map3D fsio8_Map3D_f32t; +typedef Map3D script2_Map3D_f32t; typedef Map3D fsio8_Map3D_u8t; typedef Map3D script4_Map3D_u8t; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index d404e56172..0b2c702042 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -219,6 +219,8 @@ struct_no_prefix engine_configuration_s #define PERCENT_TRIM_BYTE_PACKING_DIV 0.02 #define SCRIPT_TABLE_8 8 +#define TABLE_2_RPM_SIZE 8 +#define TABLE_2_LOAD_SIZE 8 #define SCRIPT_CURVE_8 8 #define SCRIPT_CURVE_16 16 @@ -1824,9 +1826,9 @@ float[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable1;;"value", 1, 0, -100000, 100 int16_t[SCRIPT_TABLE_8] scriptTable1LoadBins;;"L", 1, 0, -32000, 32000, 0 int16_t[SCRIPT_TABLE_8] scriptTable1RpmBins;;"RPM", 1, 0, -32000, 32000, 0 -uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable2;;"value", 1, 0, 0, 255, 0 -int16_t[SCRIPT_TABLE_8] scriptTable2LoadBins;;"L", 1, 0, -32000, 32000, 0 -int16_t[SCRIPT_TABLE_8] scriptTable2RpmBins;;"RPM", 1, 0, -32000, 32000, 0 +float[TABLE_2_LOAD_SIZE x TABLE_2_RPM_SIZE] scriptTable2;;"value", 1, 0, -100000, 100000, 2 +int16_t[TABLE_2_LOAD_SIZE] scriptTable2LoadBins;;"L", 1, 0, -32000, 32000, 0 +int16_t[TABLE_2_RPM_SIZE] scriptTable2RpmBins;;"RPM", 1, 0, -32000, 32000, 0 uint8_t[SCRIPT_TABLE_8 x SCRIPT_TABLE_8] scriptTable3;;"value", 1, 0, 0, 255, 0 int16_t[SCRIPT_TABLE_8] scriptTable3LoadBins;;"L", 1, 0, -32000, 32000, 0