platform: provide free ram metrics

This commit is contained in:
Torrie Fischer 2023-02-18 15:43:15 +01:00
parent 2a602225d2
commit 56e2e76954
2 changed files with 9 additions and 0 deletions

View File

@ -68,6 +68,14 @@ Platform::version()
#endif #endif
} }
int
Platform::freeRam()
{
#ifdef BOARD_ESP8266
return ESP.getFreeHeap();
#endif
}
void void
Platform::preSetup() Platform::preSetup()
{ {

View File

@ -32,6 +32,7 @@ class Platform : public Task {
void loop() override; void loop() override;
static bool getLocalTime(struct tm* timedata); static bool getLocalTime(struct tm* timedata);
static const char* deviceID(); static const char* deviceID();
static int freeRam();
struct TaskRegistration { struct TaskRegistration {
Task* task = 0; Task* task = 0;