Working on getting diagnostics working
This commit is contained in:
@@ -13,29 +13,37 @@ void DiagnosticsState::update()
|
||||
current.cpuFrequency =
|
||||
ESP.getCpuFreqMHz();
|
||||
|
||||
history[historyIndex] = current;
|
||||
|
||||
historyIndex++;
|
||||
if(historyIndex >= DIAGNOSTIC_HISTORY_SIZE)
|
||||
{
|
||||
historyIndex = 0;
|
||||
}
|
||||
//history[historyIndex] = current;
|
||||
//
|
||||
//historyIndex++;
|
||||
//if(historyIndex >= DIAGNOSTIC_HISTORY_SIZE)
|
||||
//{
|
||||
// historyIndex = 0;
|
||||
//}
|
||||
Serial.print("#update: ");
|
||||
Serial.println(current.freeHeap);
|
||||
Serial.println("Calling current from update");
|
||||
getCurrent();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DiagnosticSample DiagnosticsState::getCurrent()
|
||||
{
|
||||
Serial.print("#getCurrent: ");
|
||||
Serial.println(current.freeHeap);
|
||||
Serial.println(current.timestamp);
|
||||
return current;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DiagnosticSample DiagnosticsState::getHistory(uint8_t index)
|
||||
{
|
||||
if(index >= DIAGNOSTIC_HISTORY_SIZE)
|
||||
{
|
||||
return current;
|
||||
}
|
||||
return history[index];
|
||||
}
|
||||
//DiagnosticSample DiagnosticsState::getHistory(uint8_t index)
|
||||
//{
|
||||
// if(index >= DIAGNOSTIC_HISTORY_SIZE)
|
||||
// {
|
||||
// return current;
|
||||
// }
|
||||
// return history[index];
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user