Minor changes to tooth history log

This commit is contained in:
Josh Stewart 2015-09-08 09:49:34 +10:00
parent 2a54aa28a4
commit 2afa003939
4 changed files with 9 additions and 11 deletions

View File

@ -508,7 +508,7 @@ void sendToothLog(bool useChar)
//We need 256 records to send to TunerStudio. If there aren't that many in the buffer (Buffer is 512 long) then we just return and wait for the next call
if (toothHistoryIndex < 256) { return; } //Don't believe this is the best way to go. Just display whatever is in the buffer
int tempToothHistory[512]; //Create a temporary array that will contain a copy of what is in the main toothHistory array
unsigned int tempToothHistory[512]; //Create a temporary array that will contain a copy of what is in the main toothHistory array
//Copy the working history into the temporary buffer array. This is done so that, if the history loops whilst the values are being sent over serial, it doesn't affect the values
memcpy( (void*)tempToothHistory, (void*)toothHistory, sizeof(tempToothHistory) );
@ -526,11 +526,11 @@ void sendToothLog(bool useChar)
{
for(int x=0; x<256; x++)
{
Serial.write(lowByte(tempToothHistory[x]));
Serial.write(highByte(tempToothHistory[x]));
Serial.write(lowByte(tempToothHistory[x]));
}
}
Serial.flush();
//Serial.flush();
}

View File

@ -8,8 +8,8 @@ volatile unsigned long toothLastToothTime = 0; //The time (micros()) that the la
volatile unsigned long toothLastMinusOneToothTime = 0; //The time (micros()) that the tooth before the last tooth was registered
volatile unsigned long toothOneTime = 0; //The time (micros()) that tooth 1 last triggered
volatile unsigned long toothOneMinusOneTime = 0; //The 2nd to last time (micros()) that tooth 1 last triggered
volatile int toothHistory[512];
volatile int toothHistoryIndex = 0;
volatile unsigned int toothHistory[512];
volatile unsigned int toothHistoryIndex = 0;
volatile byte secondaryToothCount; //Used for identifying the current secondary (Usually cam) tooth for patterns with multiple secondary teeth
volatile unsigned long secondaryLastToothTime = 0; //The time (micros()) that the last tooth was registered (Cam input)

View File

@ -362,8 +362,6 @@ extern byte ignitionCount;
extern byte cltCalibrationTable[CALIBRATION_TABLE_SIZE];
extern byte iatCalibrationTable[CALIBRATION_TABLE_SIZE];
extern byte o2CalibrationTable[CALIBRATION_TABLE_SIZE];
extern volatile int toothHistory[512];
extern volatile int toothHistoryIndex;
#endif // GLOBALS_H

View File

@ -604,8 +604,8 @@ page = 7
dialog = triggerSettings,"Trigger Settings",4
topicHelp = Shelp3
field = "Trigger Pattern", TrigPattern
field = "Primary base teeth", numteeth, { TrigPattern != 1 }
field = "Primary trigger speed", TrigSpeed, { TrigPattern != 1 }
field = "Primary base teeth", numteeth, { TrigPattern == 0 }
field = "Primary trigger speed", TrigSpeed, { TrigPattern == 0 }
field = "Missing teeth", onetwo, { TrigPattern == 0 }
field = "Secondary teeth", onetwo, { TrigPattern == 2 }
field = "Trigger Angle ", TrigAng
@ -1212,13 +1212,13 @@ help = helpEnrichments, "Enrichments Help"
dataReadCommand = "T" ; Basic TS command format
dataReadTimeout = 10000 ; time in ms
;dataReadyCondition = { ( status3 & 0x02 ) == 0x02 }
;dataLength = 1024 ; in bytes, including headers, footers and data (not used)
dataLength = 512 ; in bytes, including headers, footers and data (not used)
;recordDef = headerLen. footerLen, recordLen
recordDef = 0, 0, 2; in bytes, the recordLen is for each record, currently limited to 4 bytes
;recordField = Name, HeaderName, startBit, bitCount, scale, units, updateCondition
recordField = toothGap, "ToothTime", 0, 8, 1.0, "uS"
recordField = toothGap, "ToothTime", 0, 16, 1.0, "uS"
[Tools]