Pass fuel pulse width full value to TS

This commit is contained in:
Josh Stewart 2017-10-10 21:58:03 +11:00
parent b93b0939ac
commit e921901fc0
2 changed files with 45 additions and 43 deletions

View File

@ -2153,7 +2153,7 @@ cmdtestspk450dc = "E\x03\x0C"
egoCorrGauge = egoCorrection, "EGO Correction", "%", 50, 150, 90, 99, 101, 110, 0, 0
gammaEnrichGauge = gammaEnrich, "Gamma Enrichment", "%", 50, 150, -1, -1, 151, 151, 0, 0
pulseWidthGauge = pulseWidth, "Pulse Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 1, 1
pulseWidthGauge = pulseWidth, "Pulse Width", "mSec", 0, 35.0, 1.0, 1.2, 20, 25, 3, 3
tachometer = rpm, "Engine Speed", "RPM", 0, 8000, 300, 600, 3000, 5000, 0, 0
throttleGauge = throttle, "Throttle Position", "%TPS", 0, 100, -1, 1, 90, 100, 0, 0
tpsGauge = tps, "Throttle Position2", "%TPS", 0, 100, -1, 1, 90, 100, 0, 0
@ -2325,7 +2325,7 @@ cmdtestspk450dc = "E\x03\x0C"
deadValue = { 0 } ; Convenient unchanging value.
ochGetCommand = "r\$tsCanId\x30%2o%2c"
ochBlockSize = 74
ochBlockSize = 75
secl = scalar, U08, 0, "sec", 1.000, 0.000
squirt = scalar, U08, 1, "bits", 1.000, 0.000
@ -2361,30 +2361,28 @@ cmdtestspk450dc = "E\x03\x0C"
gammaEnrich = scalar, U08, 17, "%", 1.000, 0.000
veCurr = scalar, U08, 18, "%", 1.000, 0.000
afrTarget = scalar, U08, 19, "O2", 0.100, 0.000
pulseWidth = scalar, U08, 20, "ms", 0.1, 0.000
TPSdot = scalar, U08, 21, "%/s", 10.00, 0.000
advance = scalar, S08, 22, "deg", 1.000, 0.000
tps = scalar, U08, 23, "%", 1.000, 0.000
loopsPerSecond = scalar, U16, 24, "loops", 1.000, 0.000
freeRAM = scalar, U16, 26, "bytes", 1.000, 0.000
boostTarget = scalar, U08, 28, "kPa", 2.000, 0.000
boostDuty = scalar, U08, 29, "%", 1.000, 0.000
spark = scalar, U08, 30, "bits", 1.000, 0.000
launchHard = bits, U08, 30, [0:0]
launchSoft = bits, U08, 30, [1:1]
hardLimitOn = bits, U08, 30, [2:2]
softlimitOn = bits, U08, 30, [3:3]
boostCutSpark = bits, U08, 30, [4:4]
error = bits, U08, 30, [5:5]
idle = bits, U08, 30, [6:6]
sync = bits, U08, 30, [7:7]
rpmDOT = scalar, S16, 31, "rpm/s", 1.000, 0.000
flex = scalar, U08, 33, "%", 1.000, 0.000
flexFuelCor = scalar, U08, 34, "%", 1.000, 0.000
flexIgnCor = scalar, U08, 35, "deg", 1.000, 0.000
errors = scalar, U08, 36, "bits", 1.000, 0.000
errorNum = bits, U08, 36, [0:1]
currentError = bits, U08, 36, [2:7]
pulseWidth = scalar, U16, 20, "ms", 0.001, 0.000
TPSdot = scalar, U08, 22, "%/s", 10.00, 0.000
advance = scalar, S08, 23, "deg", 1.000, 0.000
tps = scalar, U08, 24, "%", 1.000, 0.000
loopsPerSecond = scalar, U16, 25, "loops", 1.000, 0.000
freeRAM = scalar, U16, 27, "bytes", 1.000, 0.000
boostTarget = scalar, U08, 29, "kPa", 2.000, 0.000
boostDuty = scalar, U08, 30, "%", 1.000, 0.000
spark = scalar, U08, 31, "bits", 1.000, 0.000
launchHard = bits, U08, 31, [0:0]
launchSoft = bits, U08, 31, [1:1]
hardLimitOn = bits, U08, 31, [2:2]
softlimitOn = bits, U08, 31, [3:3]
boostCutSpark = bits, U08, 31, [4:4]
error = bits, U08, 31, [5:5]
idle = bits, U08, 31, [6:6]
sync = bits, U08, 31, [7:7]
rpmDOT = scalar, S16, 32, "rpm/s", 1.000, 0.000
flex = scalar, U08, 34, "%", 1.000, 0.000
flexFuelCor = scalar, U08, 35, "%", 1.000, 0.000
flexIgnCor = scalar, U08, 36, "deg", 1.000, 0.000
idleLoad = scalar, U08, 37, { bitStringValue( idleUnits , iacAlgorithm ) }, 2.000, 0.000 ; This is a combined variable covering both PWM and stepper IACs. The units used depend on which idle algorithm is chosen
testoutputs = scalar, U08, 38, "bits", 1.000, 0.000
testenabled = bits, U08, 38, [0:0]
@ -2408,6 +2406,9 @@ cmdtestspk450dc = "E\x03\x0C"
canin_gauge14 = scalar, U16, 69, "", 1.000, 0.000
canin_gauge15 = scalar, U16, 71, "", 1.000, 0.000
tpsADC = scalar, U08, 73, "ADC",1.000, 0.000
errors = scalar, U08, 36, "bits", 1.000, 0.000
errorNum = bits, U08, 36, [0:1]
currentError = bits, U08, 36, [2:7]
; Computed output channels. See "megatuneExamples.ini" for all the
; pre-defined variables, search for "???" and you'll see them.

View File

@ -381,31 +381,31 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum)
fullStatus[17] = currentStatus.corrections; //Total GammaE (%)
fullStatus[18] = currentStatus.VE; //Current VE 1 (%)
fullStatus[19] = currentStatus.afrTarget;
fullStatus[20] = (byte)(currentStatus.PW1 / 100); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
fullStatus[21] = currentStatus.tpsDOT; //TPS DOT
fullStatus[22] = currentStatus.advance;
fullStatus[23] = currentStatus.TPS; // TPS (0% to 100%)
fullStatus[20] = lowByte(currentStatus.PW1); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
fullStatus[21] = highByte(currentStatus.PW1); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
fullStatus[22] = currentStatus.tpsDOT; //TPS DOT
fullStatus[23] = currentStatus.advance;
fullStatus[24] = currentStatus.TPS; // TPS (0% to 100%)
//Need to split the int loopsPerSecond value into 2 bytes
fullStatus[24] = lowByte(currentStatus.loopsPerSecond);
fullStatus[25] = highByte(currentStatus.loopsPerSecond);
fullStatus[25] = lowByte(currentStatus.loopsPerSecond);
fullStatus[26] = highByte(currentStatus.loopsPerSecond);
//The following can be used to show the amount of free memory
currentStatus.freeRAM = freeRam();
fullStatus[26] = lowByte(currentStatus.freeRAM); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF);
fullStatus[27] = highByte(currentStatus.freeRAM);
fullStatus[27] = lowByte(currentStatus.freeRAM); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF);
fullStatus[28] = highByte(currentStatus.freeRAM);
fullStatus[28] = (byte)(currentStatus.boostTarget >> 1); //Divide boost target by 2 to fit in a byte
fullStatus[29] = (byte)(currentStatus.boostDuty / 100);
fullStatus[30] = currentStatus.spark; //Spark related bitfield
fullStatus[29] = (byte)(currentStatus.boostTarget >> 1); //Divide boost target by 2 to fit in a byte
fullStatus[30] = (byte)(currentStatus.boostDuty / 100);
fullStatus[31] = currentStatus.spark; //Spark related bitfield
//rpmDOT must be sent as a signed integer
fullStatus[31] = lowByte(currentStatus.rpmDOT);
fullStatus[32] = highByte(currentStatus.rpmDOT);
fullStatus[32] = lowByte(currentStatus.rpmDOT);
fullStatus[33] = highByte(currentStatus.rpmDOT);
fullStatus[33] = currentStatus.ethanolPct; //Flex sensor value (or 0 if not used)
fullStatus[34] = currentStatus.flexCorrection; //Flex fuel correction (% above or below 100)
fullStatus[35] = currentStatus.flexIgnCorrection; //Ignition correction (Increased degrees of advance) for flex fuel
fullStatus[36] = getNextError();
fullStatus[34] = currentStatus.ethanolPct; //Flex sensor value (or 0 if not used)
fullStatus[35] = currentStatus.flexCorrection; //Flex fuel correction (% above or below 100)
fullStatus[36] = currentStatus.flexIgnCorrection; //Ignition correction (Increased degrees of advance) for flex fuel
fullStatus[37] = currentStatus.idleLoad;
fullStatus[38] = currentStatus.testOutputs;
@ -447,6 +447,7 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum)
fullStatus[72] = highByte(currentStatus.canin[15]);
fullStatus[73] = currentStatus.tpsADC;
fullStatus[74] = getNextError();
for(byte x=0; x<packetLength; x++)
{