diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 12b9f6f2..687508f0 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -2083,7 +2083,7 @@ cmdtestspk450dc = "E\x03\x0C" ; mapADCGauge = mapADC, "MAP ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 #matADCGauge = matADC, "MAT ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 #cltADCGauge = cltADC, "CLT ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 - tpsADCGauge = tpsADC, "TPS ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 + ;tpsADCGauge = tpsADC, "TPS ADC", "", 0, 255, -1, -1, 256, 256, 0, 0 #batVoltGauge = batteryVoltage, "BAT V", "", 0, 255, -1, -1, 256, 256, 0, 0 accelEnrichGauge = accelEnrich, "Accel Enrich", "%", 50, 150, -1, -1, 999, 999, 0, 0 @@ -2288,39 +2288,37 @@ cmdtestspk450dc = "E\x03\x0C" mapaccaen = bits, U08, 2, [6:6] mapaccden = bits, U08, 2, [7:7] dwell = scalar, U08, 3, "ms", 0.100, 0.000 - map = scalar, U08, 4, "kpa", 2.000, 0.000 - iatRaw = scalar, U08, 5, "°C", 1.000, 0.000 - coolantRaw = scalar, U08, 6, "°C", 1.000, 0.000 - tpsADC = scalar, U08, 7, "ADC", 1.000, 0.000 - batteryVoltage = scalar, U08, 8, "V", 0.100, 0.000 - afr = scalar, U08, 9, "O2", 0.100, 0.000 - egoCorrection = scalar, U08, 10, "%", 1.000, 0.000 - airCorrection = scalar, U08, 11, "%", 1.000, 0.000 - warmupEnrich = scalar, U08, 12, "%", 1.000, 0.000 - rpm = scalar, U16, 13, "rpm", 1.000, 0.000 - accelEnrich = scalar, U08, 15, "%", 1.000, 0.000 - baro = scalar, U08, 16, "%", 1.000, 0.000 + map = scalar, U16, 4, "kpa", 1.000, 0.000 + iatRaw = scalar, U08, 6, "°C", 1.000, 0.000 + coolantRaw = scalar, U08, 7, "°C", 1.000, 0.000 + batCorrection = scalar, U08, 8, "%", 1.000, 0.000 + batteryVoltage = scalar, U08, 9, "V", 0.100, 0.000 + afr = scalar, U08, 10, "O2", 0.100, 0.000 + egoCorrection = scalar, U08, 11, "%", 1.000, 0.000 + airCorrection = scalar, U08, 12, "%", 1.000, 0.000 + warmupEnrich = scalar, U08, 13, "%", 1.000, 0.000 + rpm = scalar, U16, 14, "rpm", 1.000, 0.000 + accelEnrich = scalar, U08, 16, "%", 1.000, 0.000 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, U08, 22, "deg", 1.000, 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 - batCorrection = scalar, U08, 28, "%", 1.000, 0.000 - spark = scalar, U08, 29, "bits", 1.000, 0.000 - launchHard = bits, U08, 29, [0:0] - launchSoft = bits, U08, 29, [1:1] - hardLimitOn = bits, U08, 29, [2:2] - softlimitOn = bits, U08, 29, [3:3] - boostCutSpark = bits, U08, 29, [4:4] - error = bits, U08, 29, [5:5] - idle = bits, U08, 29, [6:6] - sync = bits, U08, 29, [7:7] - afr2 = scalar, U08, 30, "O2", 0.100, 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 @@ -2328,12 +2326,12 @@ cmdtestspk450dc = "E\x03\x0C" errors = scalar, U08, 36, "bits", 1.000, 0.000 errorNum = bits, U08, 36, [0:1] currentError = bits, U08, 36, [2:7] - boostTarget = scalar, U08, 37, "kPa", 2.000, 0.000 - boostDuty = scalar, U08, 38, "%", 1.000, 0.000 - idleLoad = scalar, U08, 39, { 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, 40, "bits", 1.000, 0.000 - testenabled = bits, U08, 40, [0:0] - testactive = bits, U08, 40, [1:1] + 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] + testactive = bits, U08, 38, [1:1] + afr2 = scalar, U08, 39, "O2", 0.100, 0.000 + baro = scalar, U08, 40, "%", 1.000, 0.000 canin_gauge0 = scalar, U16, 41, "", 1.000, 0.000 canin_gauge1 = scalar, U16, 43, "", 1.000, 0.000 canin_gauge2 = scalar, U16, 45, "", 1.000, 0.000 @@ -2343,13 +2341,13 @@ cmdtestspk450dc = "E\x03\x0C" canin_gauge6 = scalar, U16, 53, "", 1.000, 0.000 canin_gauge7 = scalar, U16, 55, "", 1.000, 0.000 canin_gauge8 = scalar, U16, 57, "", 1.000, 0.000 - canin_gauge9 = scalar, U16, 59, "", 1.000, 0.000 - canin_gauge10 = scalar, U16, 61, "", 1.000, 0.000 - canin_gauge11 = scalar, U16, 63, "", 1.000, 0.000 - canin_gauge12 = scalar, U16, 65, "", 1.000, 0.000 - canin_gauge13 = scalar, U16, 67, "", 1.000, 0.000 - canin_gauge14 = scalar, U16, 69, "", 1.000, 0.000 - canin_gauge15 = scalar, U16, 71, "", 1.000, 0.000 + canin_gauge9 = scalar, U16, 59, "", 1.000, 0.000 + canin_gauge10 = scalar, U16, 61, "", 1.000, 0.000 + canin_gauge11 = scalar, U16, 63, "", 1.000, 0.000 + canin_gauge12 = scalar, U16, 65, "", 1.000, 0.000 + canin_gauge13 = scalar, U16, 67, "", 1.000, 0.000 + canin_gauge14 = scalar, U16, 69, "", 1.000, 0.000 + canin_gauge15 = scalar, U16, 71, "", 1.000, 0.000 ; Computed output channels. See "megatuneExamples.ini" for all the ; pre-defined variables, search for "???" and you'll see them. @@ -2430,7 +2428,6 @@ cmdtestspk450dc = "E\x03\x0C" entry = rpm, "RPM", int, "%d" entry = map, "MAP", int, "%d" entry = MAPxRPM, "MAPxRPM", int, "%d" - entry = tpsADC, "tpsADC", int, "%d" entry = tps, "TPS", int, "%d" entry = afr, "O2", float, "%.3f" entry = lambda, "Lambda", float, "%.3f" @@ -2466,6 +2463,7 @@ cmdtestspk450dc = "E\x03\x0C" entry = boostCutOut , "Boost cut", int, "%d" entry = idleLoad, "IAC value", int, "%d" +#if CAN_COMMANDS entry = canin_gauge0, "CanIn CH0", int, "%d" entry = canin_gauge1, "CanIn CH1", int, "%d" entry = canin_gauge2, "CanIn CH2", int, "%d" @@ -2474,6 +2472,7 @@ cmdtestspk450dc = "E\x03\x0C" entry = canin_gauge5, "CanIn CH5", int, "%d" entry = canin_gauge6, "CanIn CH6", int, "%d" entry = canin_gauge7, "CanIn CH7", int, "%d" +#endif [LoggerDefinition] diff --git a/speeduino/comms.ino b/speeduino/comms.ino index 620f8a61..04d82ed2 100644 --- a/speeduino/comms.ino +++ b/speeduino/comms.ino @@ -275,19 +275,19 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum) fullStatus[1] = currentStatus.squirt; //Squirt Bitfield fullStatus[2] = currentStatus.engine; //Engine Status Bitfield fullStatus[3] = (byte)(divu100(currentStatus.dwell)); //Dwell in ms * 10 - fullStatus[4] = (byte)(currentStatus.MAP >> 1); //map value is divided by 2 - fullStatus[5] = (byte)(currentStatus.IAT + CALIBRATION_TEMPERATURE_OFFSET); //mat - fullStatus[6] = (byte)(currentStatus.coolant + CALIBRATION_TEMPERATURE_OFFSET); //Coolant ADC - fullStatus[7] = currentStatus.tpsADC; //TPS (Raw 0-255) - fullStatus[8] = currentStatus.battery10; //battery voltage - fullStatus[9] = currentStatus.O2; //O2 - fullStatus[10] = currentStatus.egoCorrection; //Exhaust gas correction (%) - fullStatus[11] = currentStatus.iatCorrection; //Air temperature Correction (%) - fullStatus[12] = currentStatus.wueCorrection; //Warmup enrichment (%) - fullStatus[13] = lowByte(currentStatus.RPM); //rpm HB - fullStatus[14] = highByte(currentStatus.RPM); //rpm LB - fullStatus[15] = currentStatus.TAEamount; //acceleration enrichment (%) - fullStatus[16] = currentStatus.baro; //Barometer value + fullStatus[4] = lowByte(currentStatus.MAP); //2 bytes for MAP + fullStatus[5] = highByte(currentStatus.MAP); + fullStatus[6] = (byte)(currentStatus.IAT + CALIBRATION_TEMPERATURE_OFFSET); //mat + fullStatus[7] = (byte)(currentStatus.coolant + CALIBRATION_TEMPERATURE_OFFSET); //Coolant ADC + fullStatus[8] = currentStatus.batCorrection; //Battery voltage correction (%) + fullStatus[9] = currentStatus.battery10; //battery voltage + fullStatus[10] = currentStatus.O2; //O2 + fullStatus[11] = currentStatus.egoCorrection; //Exhaust gas correction (%) + fullStatus[12] = currentStatus.iatCorrection; //Air temperature Correction (%) + fullStatus[13] = currentStatus.wueCorrection; //Warmup enrichment (%) + fullStatus[14] = lowByte(currentStatus.RPM); //rpm HB + fullStatus[15] = highByte(currentStatus.RPM); //rpm LB + fullStatus[16] = currentStatus.TAEamount; //acceleration enrichment (%) fullStatus[17] = currentStatus.corrections; //Total GammaE (%) fullStatus[18] = currentStatus.VE; //Current VE 1 (%) fullStatus[19] = currentStatus.afrTarget; @@ -304,9 +304,9 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum) fullStatus[26] = lowByte(currentStatus.freeRAM); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF); fullStatus[27] = highByte(currentStatus.freeRAM); - fullStatus[28] = currentStatus.batCorrection; //Battery voltage correction (%) - fullStatus[29] = currentStatus.spark; //Spark related bitfield - fullStatus[30] = currentStatus.O2_2; //O2 + fullStatus[28] = currentStatus.boostTarget; + fullStatus[29] = currentStatus.boostDuty; + fullStatus[30] = currentStatus.spark; //Spark related bitfield //rpmDOT must be sent as a signed integer fullStatus[31] = lowByte(currentStatus.rpmDOT); @@ -316,10 +316,13 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum) 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[37] = currentStatus.boostTarget; - fullStatus[38] = currentStatus.boostDuty; - fullStatus[39] = currentStatus.idleLoad; - fullStatus[40] = currentStatus.testOutputs; + + fullStatus[37] = currentStatus.idleLoad; + fullStatus[38] = currentStatus.testOutputs; + + fullStatus[39] = currentStatus.O2_2; //O2 + fullStatus[40] = currentStatus.baro; //Barometer value + fullStatus[41] = lowByte(currentStatus.canin[0]); fullStatus[42] = highByte(currentStatus.canin[0]); fullStatus[43] = lowByte(currentStatus.canin[1]);