From 5b876b252a6160f2c32fb77346a100e45a0c8b45 Mon Sep 17 00:00:00 2001 From: Bruno Bousquet Date: Sun, 10 Nov 2019 03:04:32 -0500 Subject: [PATCH] fix WUE lookup function and add missing commas in speeduino.ini (#278) * fix WUE lookup * fix missing commas in speeduino.ini * fix correctionWUE --- reference/speeduino.ini | 52 +++++++++++++++++++-------------------- speeduino/corrections.ino | 2 +- speeduino/table.h | 6 ++--- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 692958b0..10322f4b 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -1093,7 +1093,7 @@ page = 11 defaultValue = dutyLim, 80 defaultValue = mapMin, 10 defaultValue = mapMax, 260 - defaultValue = baroMin 10 + defaultValue = baroMin, 10 defaultValue = baroMax, 260 defaultValue = useEMAP, 0 defaultValue = EMAPMin, 10 @@ -1148,13 +1148,13 @@ page = 11 defaultValue = resetControlPin, 0 ;Default ADC filter values - defaultValue = ADCFILTER_TPS 50 - defaultValue = ADCFILTER_CLT 180 - defaultValue = ADCFILTER_IAT 180 - defaultValue = ADCFILTER_O2 100 - defaultValue = ADCFILTER_BAT 128 - defaultValue = ADCFILTER_MAP 20 ;This is only used on Instantaneous MAP readings and is intentionally very weak to allow for faster response - defaultValue = ADCFILTER_BARO 64 + defaultValue = ADCFILTER_TPS, 50 + defaultValue = ADCFILTER_CLT, 180 + defaultValue = ADCFILTER_IAT, 180 + defaultValue = ADCFILTER_O2, 100 + defaultValue = ADCFILTER_BAT, 128 + defaultValue = ADCFILTER_MAP, 20 ;This is only used on Instantaneous MAP readings and is intentionally very weak to allow for faster response + defaultValue = ADCFILTER_BARO, 64 ;Force the controller priority for the filters (Controller knows best here when in doubt) controllerPriority = ADCFILTER_TPS controllerPriority = ADCFILTER_CLT @@ -1177,22 +1177,22 @@ page = 11 controllerPriority = bootloaderCaps - defaultValue = AUXin00Alias Aux0 - defaultValue = AUXin01Alias Aux1 - defaultValue = AUXin02Alias Aux2 - defaultValue = AUXin03Alias Aux3 - defaultValue = AUXin04Alias Aux4 - defaultValue = AUXin05Alias Aux5 - defaultValue = AUXin06Alias Aux6 - defaultValue = AUXin07Alias Aux7 - defaultValue = AUXin08Alias Aux8 - defaultValue = AUXin09Alias Aux9 - defaultValue = AUXin10Alias Aux10 - defaultValue = AUXin11Alias Aux11 - defaultValue = AUXin12Alias Aux12 - defaultValue = AUXin13Alias Aux13 - defaultValue = AUXin14Alias Aux14 - defaultValue = AUXin15Alias Aux15 + defaultValue = AUXin00Alias, Aux0 + defaultValue = AUXin01Alias, Aux1 + defaultValue = AUXin02Alias, Aux2 + defaultValue = AUXin03Alias, Aux3 + defaultValue = AUXin04Alias, Aux4 + defaultValue = AUXin05Alias, Aux5 + defaultValue = AUXin06Alias, Aux6 + defaultValue = AUXin07Alias, Aux7 + defaultValue = AUXin08Alias, Aux8 + defaultValue = AUXin09Alias, Aux9 + defaultValue = AUXin10Alias, Aux10 + defaultValue = AUXin11Alias, Aux11 + defaultValue = AUXin12Alias, Aux12 + defaultValue = AUXin13Alias, Aux13 + defaultValue = AUXin14Alias, Aux14 + defaultValue = AUXin15Alias, Aux15 [Menu] @@ -1252,7 +1252,7 @@ menuDialog = main subMenu = dwellSettings, "Dwell settings" subMenu = dwell_correction_curve, "Dwell Compensation" subMenu = idleAdvanceSettings, "Idle Advance Settings" - subMenu = idle_advance_curve, "Idle Advance" { idleAdvEnabled >= 1 } + subMenu = idle_advance_curve, "Idle Advance", { idleAdvEnabled >= 1 } subMenu = iat_retard_curve, "IAT Retard" subMenu = clt_advance_curve, "Cold Advance" ;subMenu = knockSettings, "Knock Settings" @@ -1380,7 +1380,7 @@ menuDialog = main idleUpPolarity = "Normal polarity is a ground switch where an earthed signal activates the Idle Up. The internal pullup will be enabled with Normal polarity. \n Inverted may be used if a 5v signal is used to enable the Idle Up." CTPSPolarity = "Normal polarity is a ground switch where an earthed signal activates the closed throttle position. The internal pullup will be enabled with Normal polarity. \n Inverted may be used if a 5v signal is used to enable the closed throttle position." idleUpAdder = "The amount (In either Duty Cycle % or Steps (Depending on the idle control method in use), that the idle control will increase by when Idle Up is active" - idleAdvEnabled = "Added setting adds curve values to current spark table values when user defined idle is active. \n Switched setting overrides spark table values and uses curve values for idle ignition timing. + idleAdvEnabled = "Added setting adds curve values to current spark table values when user defined idle is active. \n Switched setting overrides spark table values and uses curve values for idle ignition timing." idleAdvAlgorithm = "Use Throttle position sensor (TPS) or closed throttle position sensor (CTPS) to detect idle state." oddfire2 = "The ATDC angle of channel 2 for oddfire engines. This is relative to the TDC angle of channel 1" diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index 7c00c1a0..fe6354a3 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -108,7 +108,7 @@ static inline byte correctionWUE() //This prevents us doing the 2D lookup if we're already up to temp BIT_CLEAR(currentStatus.engine, BIT_ENGINE_WARMUP); //WUEValue = WUETable.values[9]; //Set the current value to be whatever the final value on the curve is. - WUEValue = table2D_getAxisValue(&WUETable, 9); + WUEValue = table2D_getRawValue(&WUETable, 9); } else { diff --git a/speeduino/table.h b/speeduino/table.h index 787967d2..52ffabac 100644 --- a/speeduino/table.h +++ b/speeduino/table.h @@ -34,9 +34,9 @@ struct table2D { }; //void table2D_setSize(struct table2D targetTable, byte newSize); -void table2D_setSize(struct table2D, byte); -int16_t table2D_getAxisValue(struct table2D, byte); -int16_t table2D_getRawValue(struct table2D, byte); +void table2D_setSize(struct table2D*, byte); +int16_t table2D_getAxisValue(struct table2D*, byte); +int16_t table2D_getRawValue(struct table2D*, byte); struct table3D {