Minor ini and comms cleanup
This commit is contained in:
parent
630a3bfe2a
commit
fc06ce4d1b
|
@ -293,7 +293,7 @@ page = 4
|
||||||
;Dwell control
|
;Dwell control
|
||||||
dwellcont = bits, U08, 12, [0:0], "INVALID", "Dwell control"
|
dwellcont = bits, U08, 12, [0:0], "INVALID", "Dwell control"
|
||||||
useDwellLim= bits, U08, 12, [1:1], "Off", "On"
|
useDwellLim= bits, U08, 12, [1:1], "Off", "On"
|
||||||
sparkMode = bits, U08, 12, [2:4], "Wasted Spark", "Single Channel", "Wasted COP", "Sequential", "Rotary", INVALID, INVALID, INVALID
|
sparkMode = bits, U08, 12, [2:4], "Wasted Spark", "Single Channel", "Wasted COP", "Sequential", "Rotary", "INVALID", "INVALID", "INVALID"
|
||||||
TrigFilter = bits, U08, 12, [5:6], "Off", "Weak", "Medium", "Aggressive"
|
TrigFilter = bits, U08, 12, [5:6], "Off", "Weak", "Medium", "Aggressive"
|
||||||
ignCranklock=bits, U08, 12, [7:7], "Off", "On"
|
ignCranklock=bits, U08, 12, [7:7], "Off", "On"
|
||||||
dwellcrank = scalar, U08, 13, "ms", 0.1, 0, 0, 25, 1
|
dwellcrank = scalar, U08, 13, "ms", 0.1, 0, 0, 25, 1
|
||||||
|
|
|
@ -62,15 +62,11 @@ void command()
|
||||||
if (Serial.available() > 0)
|
if (Serial.available() > 0)
|
||||||
{
|
{
|
||||||
currentPage = Serial.read();
|
currentPage = Serial.read();
|
||||||
if (currentPage >= '0') {//This converts the ascii number char into binary
|
//This converts the ascii number char into binary. Note that this will break everyything if there are ever more than 48 pages (48 = asci code for '0')
|
||||||
currentPage -= '0';
|
if (currentPage >= '0') { currentPage -= '0'; }
|
||||||
}
|
// Detecting if the current page is a table/map
|
||||||
if ( (currentPage == veMapPage) || (currentPage == ignMapPage) || (currentPage == afrMapPage) ) { // Detecting if the current page is a table/map
|
if ( (currentPage == veMapPage) || (currentPage == ignMapPage) || (currentPage == afrMapPage) ) { isMap = true; }
|
||||||
isMap = true;
|
else { isMap = false; }
|
||||||
}
|
|
||||||
else {
|
|
||||||
isMap = false;
|
|
||||||
}
|
|
||||||
cmdPending = false;
|
cmdPending = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -507,7 +503,6 @@ void receiveValue(int valueOffset, byte newValue)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case seqFuelPage:
|
case seqFuelPage:
|
||||||
{
|
|
||||||
int tempOffset;
|
int tempOffset;
|
||||||
if (valueOffset < 36) { trim1Table.values[5 - (valueOffset / 6)][valueOffset % 6] = newValue; } //Trim1 values
|
if (valueOffset < 36) { trim1Table.values[5 - (valueOffset / 6)][valueOffset % 6] = newValue; } //Trim1 values
|
||||||
else if (valueOffset < 42) { trim1Table.axisX[(valueOffset - 36)] = int(newValue) * TABLE_RPM_MULTIPLIER; } //New value is on the X (RPM) axis of the trim1 table. The RPM values sent by TunerStudio are divided by 100, need to multiply it back by 100 to make it correct (TABLE_RPM_MULTIPLIER)
|
else if (valueOffset < 42) { trim1Table.axisX[(valueOffset - 36)] = int(newValue) * TABLE_RPM_MULTIPLIER; } //New value is on the X (RPM) axis of the trim1 table. The RPM values sent by TunerStudio are divided by 100, need to multiply it back by 100 to make it correct (TABLE_RPM_MULTIPLIER)
|
||||||
|
@ -524,7 +519,7 @@ void receiveValue(int valueOffset, byte newValue)
|
||||||
else if (valueOffset < 180) { tempOffset = valueOffset - 144; trim4Table.values[5 - (tempOffset / 6)][tempOffset % 6] = newValue; } //New value is part of the trim2 map
|
else if (valueOffset < 180) { tempOffset = valueOffset - 144; trim4Table.values[5 - (tempOffset / 6)][tempOffset % 6] = newValue; } //New value is part of the trim2 map
|
||||||
else if (valueOffset < 186) { tempOffset = valueOffset - 180; trim4Table.axisX[tempOffset] = int(newValue) * TABLE_RPM_MULTIPLIER; } //New value is on the X (RPM) axis of the table. The RPM values sent by TunerStudio are divided by 100, need to multiply it back by 100 to make it correct (TABLE_RPM_MULTIPLIER)
|
else if (valueOffset < 186) { tempOffset = valueOffset - 180; trim4Table.axisX[tempOffset] = int(newValue) * TABLE_RPM_MULTIPLIER; } //New value is on the X (RPM) axis of the table. The RPM values sent by TunerStudio are divided by 100, need to multiply it back by 100 to make it correct (TABLE_RPM_MULTIPLIER)
|
||||||
else if (valueOffset < 192) { tempOffset = valueOffset - 186; trim4Table.axisY[(5 - tempOffset)] = int(newValue) * TABLE_LOAD_MULTIPLIER; } //New value is on the Y (Load) axis of the table
|
else if (valueOffset < 192) { tempOffset = valueOffset - 186; trim4Table.axisY[(5 - tempOffset)] = int(newValue) * TABLE_LOAD_MULTIPLIER; } //New value is on the Y (Load) axis of the table
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case canbusPage:
|
case canbusPage:
|
||||||
|
@ -536,7 +531,7 @@ void receiveValue(int valueOffset, byte newValue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case warmupPage: //Idle Air Control settings page (Page 4)
|
case warmupPage:
|
||||||
pnt_configPage = &configPage11;
|
pnt_configPage = &configPage11;
|
||||||
//For some reason, TunerStudio is sending offsets greater than the maximum page size. I'm not sure if it's their bug or mine, but the fix is to only update the config page if the offset is less than the maximum size
|
//For some reason, TunerStudio is sending offsets greater than the maximum page size. I'm not sure if it's their bug or mine, but the fix is to only update the config page if the offset is less than the maximum size
|
||||||
if (valueOffset < npage_size[currentPage])
|
if (valueOffset < npage_size[currentPage])
|
||||||
|
@ -940,7 +935,7 @@ void sendPage(bool useChar)
|
||||||
}
|
}
|
||||||
else currentTitleIndex = 0;
|
else currentTitleIndex = 0;
|
||||||
}while(currentTitleIndex == 132); //Should never loop unless going to display vvtTable
|
}while(currentTitleIndex == 132); //Should never loop unless going to display vvtTable
|
||||||
}
|
} //use char
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Need to perform a translation of the values[yaxis][xaxis] into the MS expected format
|
//Need to perform a translation of the values[yaxis][xaxis] into the MS expected format
|
||||||
|
@ -955,7 +950,7 @@ void sendPage(bool useChar)
|
||||||
//loop();
|
//loop();
|
||||||
Serial.write((byte *)&response, sizeof(response));
|
Serial.write((byte *)&response, sizeof(response));
|
||||||
}
|
}
|
||||||
}
|
} //is map
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*if(useChar)
|
/*if(useChar)
|
||||||
|
|
Loading…
Reference in New Issue