Added runtime time logger

This commit is contained in:
Magnus Persson
2022-01-30 22:54:48 +01:00
parent 2e67bd1d57
commit 22ade61af8
7 changed files with 124 additions and 57 deletions

View File

@ -30,6 +30,8 @@ SOFTWARE.
#define ERR_FILENAME "/error.log"
#define ERR_COUNT 15
#define RUNTIME_FILENAME "/runtime.log"
// Sleep mode
void deepSleep(int t);
@ -64,15 +66,28 @@ class SerialDebug {
class ErrorFileLog {
private:
String errors[ERR_COUNT];
String _errors[ERR_COUNT];
public:
ErrorFileLog();
const char* getEntry(int idx);
void addEntry(String error);
void save();
};
class FloatHistoryLog {
private:
String _fName;
float _average = 0;
float _runTime[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int _count = 0;
void save();
public:
FloatHistoryLog(String fName);
void addEntry(float time);
float getAverage() { return _average; }
};
class BatteryVoltage {
private:
float _batteryLevel;