Send dwell value as 16 rather than 8 bit to TS. Fixes #203

This commit is contained in:
Josh Stewart 2019-03-15 17:35:18 +11:00
parent d422221bab
commit 4f4781a234
3 changed files with 10 additions and 8 deletions

View File

@ -3137,7 +3137,7 @@ cmdtestspk450dc = "E\x03\x0C"
; you change it.
ochGetCommand = "r\$tsCanId\x30%2o%2c"
ochBlockSize = 90
ochBlockSize = 91
secl = scalar, U08, 0, "sec", 1.000, 0.000
status1 = scalar, U08, 1, "bits", 1.000, 0.000
@ -3158,10 +3158,10 @@ cmdtestspk450dc = "E\x03\x0C"
tpsaccden = bits, U08, 2, [5:5]
mapaccaen = bits, U08, 2, [6:6]
mapaccden = bits, U08, 2, [7:7]
dwell = scalar, U08, 3, "ms", 0.100, 0.000
syncLossCounter = scalar, U08, 3, "", 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
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
@ -3235,7 +3235,8 @@ cmdtestspk450dc = "E\x03\x0C"
nFuelChannels = bits, U08, 84, [4:7]
fuelLoad = scalar, S16, 85, { bitStringValue( algorithmUnits , algorithm ) }, 1.000, 0.000
ignLoad = scalar, S16, 87, { bitStringValue( algorithmUnits , ignAlgorithm ) }, 1.000, 0.000
syncLossCounter = scalar, U08, 89, "", 1.000, 0.000
dwell = scalar, U16, 89, "ms", 0.001, 0.000
#if CELSIUS

View File

@ -12,7 +12,7 @@
#define canbusPage 9//Config Page 9
#define warmupPage 10 //Config Page 10
#define SERIAL_PACKET_SIZE 90 //Must match ochBlockSize in ini file
#define SERIAL_PACKET_SIZE 91 //Must match ochBlockSize in ini file
byte currentPage = 1;//Not the same as the speeduino config page numbers
bool isMap = true;

View File

@ -460,7 +460,7 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum)
fullStatus[0] = currentStatus.secl; //secl is simply a counter that increments each second. Used to track unexpected resets (Which will reset this count to 0)
fullStatus[1] = currentStatus.status1; //status1 Bitfield
fullStatus[2] = currentStatus.engine; //Engine Status Bitfield
fullStatus[3] = (byte)(divu100(currentStatus.dwell)); //Dwell in ms * 10
fullStatus[3] = currentStatus.syncLossCounter;
fullStatus[4] = lowByte(currentStatus.MAP); //2 bytes for MAP
fullStatus[5] = highByte(currentStatus.MAP);
fullStatus[6] = (byte)(currentStatus.IAT + CALIBRATION_TEMPERATURE_OFFSET); //mat
@ -561,7 +561,8 @@ void sendValues(uint16_t offset, uint16_t packetLength, byte cmd, byte portNum)
fullStatus[86] = highByte(currentStatus.fuelLoad);
fullStatus[87] = lowByte(currentStatus.ignLoad);
fullStatus[88] = highByte(currentStatus.ignLoad);
fullStatus[89] = currentStatus.syncLossCounter;
fullStatus[89] = lowByte(currentStatus.dwell);
fullStatus[90] = highByte(currentStatus.dwell);
for(byte x=0; x<packetLength; x++)
{