Add free mem gauge and output channel (Disable testing mode)

This commit is contained in:
Josh Stewart 2014-05-12 21:50:02 +10:00
parent 4aa57039a6
commit 6c20f6d5b8
3 changed files with 11 additions and 24 deletions

View File

@ -88,7 +88,7 @@ This function returns the current values of a fixed group of variables
*/
void sendValues(int length)
{
byte packetSize = 26;
byte packetSize = 28;
byte response[packetSize];
response[0] = currentStatus.secl; //secl is simply a counter that increments each second. Used to track unexpected resets (Which will reset this count to 0)
@ -118,12 +118,12 @@ void sendValues(int length)
//Need to split the int loopsPerSecond value into 2 bytes
response[24] = highByte(currentStatus.loopsPerSecond); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF);
response[25] = lowByte(currentStatus.loopsPerSecond); //(byte)(currentStatus.loopsPerSecond & 0xFF);
/*
//The following can be used to show the amount of free memory
int mem = freeRam();
response[24] = highByte(mem); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF);
response[25] = lowByte(mem);
*/
response[26] = highByte(mem); //(byte)((currentStatus.loopsPerSecond >> 8) & 0xFF);
response[27] = lowByte(mem);
Serial.write(response, (size_t)packetSize);
Serial.flush();

View File

@ -243,7 +243,6 @@
menu = "&Settings"
subMenu = std_constants, "&Constants"
subMenu = std_enrichments, "&Enrichments"
menu = "&Tuning"
subMenu = std_realtime, "&Realtime Display"
@ -589,7 +588,8 @@ help = helpEnrichments, "Enrichments Help"
matGauge = mat, "Manifold Air Temp", "%TEMP", -40, 215, 0, 30, 200, 210, 0, 0
#endif
advanceGauge = advance, "Spark Advance", "deg BTDC", 50, -10, 0, 0, 35, 45, 0,
loopGauge = loopsPerSecond,"Main loop speed", "Loops/S" , 0, 20000, -1, 500,1800, 4000, 0, 0
loopGauge = loopsPerSecond,"Main loop speed", "Loops/S" , 0, 20000, -1, 500,1800, 4000, 0, 0
memoryGauge = freeRAM, "Free memory", "bytes" , 0, 8000, -1, 1000,8000, 1000, 0, 0
;-------------------------------------------------------------------------------
@ -722,7 +722,7 @@ help = helpEnrichments, "Enrichments Help"
ochGetCommand = "A"
ochBlockSize = 26
ochBlockSize = 28
secl = scalar, U08, 0, "sec", 1.000, 0.000
squirt = scalar, U08, 1, "bits", 1.000, 0.000
@ -757,6 +757,7 @@ help = helpEnrichments, "Enrichments Help"
advance = scalar, U08, 22, "deg", 1.000, 0.000
tps = scalar, U08, 23, "%", 1.000, 0.000
loopsPerSecond = scalar, S16, 24, "loops", 1.000, 0.000
freeRAM = scalar, S16, 26, "bytes", 1.000, 0.000
; Computed output channels. See "megatuneExamples.ini" for all the
; pre-defined variables, search for "???" and you'll see them.

View File

@ -198,20 +198,6 @@ void loop()
}
}
/*
Serial.print("RPM: ");
Serial.println(currentStatus.RPM);
Serial.print("toothLastToothTime: ");
Serial.println(toothLastToothTime);
Serial.print("toothOneMinusOneTime: ");
Serial.println(toothOneMinusOneTime);
Serial.print("RevolutionTime: ");
Serial.println(toothOneTime-toothOneMinusOneTime);
Serial.print("Tooth Number: ");
Serial.println(toothCurrentCount);
*/
//Calculate the RPM based on the uS between the last 2 times tooth One was seen.
previousLoopTime = currentLoopTime;
currentLoopTime = micros();
@ -232,10 +218,10 @@ void loop()
}
//Uncomment the following for testing
/*
currentStatus.hasSync = true;
currentStatus.RPM = 5500;
*/
//***SET STATUSES***
//-----------------------------------------------------------------------------------------------------