* BIG refactor: 'board' and 'radio' objects now defined in 'target.h/.cpp'

* mesh::RTCClock class moved to MeshCore.h
Этот коммит содержится в:
Scott Powell
2025-03-21 18:57:12 +11:00
родитель 0a5a115875
Коммит bfb4b1c496
48 изменённых файлов: 726 добавлений и 407 удалений
+28
Просмотреть файл
@@ -45,4 +45,32 @@ public:
virtual bool startOTAUpdate() { return false; } // not supported
};
/**
* An abstraction of the device's Realtime Clock.
*/
class RTCClock {
uint32_t last_unique;
protected:
RTCClock() { last_unique = 0; }
public:
/**
* \returns the current time. in UNIX epoch seconds.
*/
virtual uint32_t getCurrentTime() = 0;
/**
* \param time current time in UNIX epoch seconds.
*/
virtual void setCurrentTime(uint32_t time) = 0;
uint32_t getCurrentTimeUnique() {
uint32_t t = getCurrentTime();
if (t <= last_unique) {
return ++last_unique;
}
return last_unique = t;
}
};
}