/* * -------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * , , * wrote this file. As long as you retain this notice you can do whatever you * want with this stuff. If you meet any of us some day, and you think this * stuff is worth it, you can buy us a beer in return. - The sys-clk authors * -------------------------------------------------------------------------- */ #pragma once #include #include #include "config.h" #include "clocks.h" #include #include "oc_extra.h" class ClockManager { public: static ClockManager* GetInstance(); static void Initialize(); static void Exit(); void SetRunning(bool running); bool Running(); void Tick(); void WaitForNextTick(); void SetRNXRTMode(ReverseNXMode mode); SysClkContext GetCurrentContext(); Config* GetConfig(); protected: ClockManager(); virtual ~ClockManager(); bool RefreshContext(); static ClockManager *instance; std::atomic_bool running; LockableMutex contextMutex; Config *config; SysClkContext *context; std::uint64_t lastTempLogNs; std::uint64_t lastCsvWriteNs; SysClkOcExtra *oc; ReverseNXSync *rnxSync; Governor *governor; bool IsBoostMode(); uint32_t GetHz(SysClkModule); };