Fixed reference errors
This commit is contained in:
@@ -14,6 +14,7 @@ board = esp32dev
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps =
|
lib_deps =
|
||||||
WebSockets
|
WebSockets
|
||||||
|
;board_build.f_cpu = 160000000L
|
||||||
;build_type = debug
|
;build_type = debug
|
||||||
|
|
||||||
; upload via OTA
|
; upload via OTA
|
||||||
|
|||||||
@@ -13,13 +13,6 @@ void DiagnosticsState::update()
|
|||||||
current.cpuFrequency =
|
current.cpuFrequency =
|
||||||
ESP.getCpuFreqMHz();
|
ESP.getCpuFreqMHz();
|
||||||
|
|
||||||
//history[historyIndex] = current;
|
|
||||||
//
|
|
||||||
//historyIndex++;
|
|
||||||
//if(historyIndex >= DIAGNOSTIC_HISTORY_SIZE)
|
|
||||||
//{
|
|
||||||
// historyIndex = 0;
|
|
||||||
//}
|
|
||||||
Serial.print("#update: ");
|
Serial.print("#update: ");
|
||||||
Serial.println(current.freeHeap);
|
Serial.println(current.freeHeap);
|
||||||
Serial.println("Calling current from update");
|
Serial.println("Calling current from update");
|
||||||
@@ -31,19 +24,14 @@ void DiagnosticsState::update()
|
|||||||
|
|
||||||
DiagnosticSample DiagnosticsState::getCurrent()
|
DiagnosticSample DiagnosticsState::getCurrent()
|
||||||
{
|
{
|
||||||
|
DiagnosticSample sample;
|
||||||
|
sample.timestamp = current.timestamp;
|
||||||
|
sample.freeHeap = current.freeHeap;
|
||||||
|
sample.minimumFreeHeap = current.minimumFreeHeap;
|
||||||
|
sample.cpuFrequency = current.cpuFrequency;
|
||||||
|
|
||||||
Serial.print("#getCurrent: ");
|
Serial.print("#getCurrent: ");
|
||||||
Serial.println(current.freeHeap);
|
Serial.println(sample.freeHeap);
|
||||||
Serial.println(current.timestamp);
|
Serial.println(sample.timestamp);
|
||||||
return current;
|
return sample;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//DiagnosticSample DiagnosticsState::getHistory(uint8_t index)
|
|
||||||
//{
|
|
||||||
// if(index >= DIAGNOSTIC_HISTORY_SIZE)
|
|
||||||
// {
|
|
||||||
// return current;
|
|
||||||
// }
|
|
||||||
// return history[index];
|
|
||||||
//}
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DiagnosticSample current;
|
volatile DiagnosticSample current;
|
||||||
//DiagnosticSample history[DIAGNOSTIC_HISTORY_SIZE];
|
//DiagnosticSample history[DIAGNOSTIC_HISTORY_SIZE];
|
||||||
//uint8_t historyIndex = 0;
|
//uint8_t historyIndex = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ private:
|
|||||||
WebServer server;
|
WebServer server;
|
||||||
WebSocketsServer webSocket;
|
WebSocketsServer webSocket;
|
||||||
|
|
||||||
DashboardState dashboardState;
|
DashboardState& dashboardState;
|
||||||
DiagnosticsState diagnosticsState;
|
DiagnosticsState& diagnosticsState;
|
||||||
|
|
||||||
void handleWebSocketMessage(uint8_t clientNum, uint8_t *payload, size_t length);
|
void handleWebSocketMessage(uint8_t clientNum, uint8_t *payload, size_t length);
|
||||||
void broadcastState();
|
void broadcastState();
|
||||||
|
|||||||
Reference in New Issue
Block a user