--- nono/vm/rtc.h 2026/04/29 17:05:11 1.1.1.9 +++ nono/vm/rtc.h 2026/04/29 17:05:18 1.1.1.10 @@ -14,13 +14,14 @@ #include "event.h" #include -// これ自体が IODevice である必要はないが派生側が IODevice を必要とするため。 +class Syncer; + class RTCDevice : public IODevice { using inherited = IODevice; public: - RTCDevice(const std::string& objname_); + RTCDevice(); virtual ~RTCDevice() override; bool Init() override; @@ -133,8 +134,12 @@ class RTCDevice : public IODevice // システムクロックが刻んでいる時刻 uint64 stime {}; + Syncer *syncer {}; + // RTC クロック入力 Event event { this }; }; -extern RTCDevice *gRTC; +static inline RTCDevice *GetRTCDevice() { + return Object::GetObject(OBJ_RTC); +}