summaryrefslogtreecommitdiffhomepage
path: root/Private/KernelKit/Timer.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-05 21:10:18 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-05 21:10:18 +0200
commitf95d8bf159d10b5a9521dcaa0bc37aa0e9dfc02b (patch)
treebf8186f1a0521a64983bb0bca4f7b54883542195 /Private/KernelKit/Timer.hpp
parent5a903c1d8f80ca8d7bc5fbea0aea710ce0133f9d (diff)
MHR-23: Add run_format.sh, kernel patches.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/KernelKit/Timer.hpp')
-rw-r--r--Private/KernelKit/Timer.hpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/Private/KernelKit/Timer.hpp b/Private/KernelKit/Timer.hpp
index dbd29af1..fac1b11f 100644
--- a/Private/KernelKit/Timer.hpp
+++ b/Private/KernelKit/Timer.hpp
@@ -13,53 +13,53 @@
namespace NewOS
{
-class HardwareTimer;
-class HardwareTimerInterface;
-
-class HardwareTimerInterface
-{
- public:
- /// @brief Default constructor
- explicit HardwareTimerInterface() = default;
- virtual ~HardwareTimerInterface() = default;
-
- public:
- NEWOS_COPY_DEFAULT(HardwareTimerInterface);
-
- public:
- virtual Int32 Wait() noexcept;
-};
-
-class HardwareTimer final : public HardwareTimerInterface
-{
- public:
- explicit HardwareTimer(Int64 seconds);
- ~HardwareTimer() override;
-
- public:
- NEWOS_COPY_DEFAULT(HardwareTimer);
-
- public:
- Int32 Wait() noexcept override;
-
- public:
- IntPtr *fDigitalTimer{nullptr};
- Int64 fWaitFor{0};
-};
-
-inline Int64 Seconds(Int64 time)
-{
- if (time < 0)
- return 0;
-
- return 1000 / time;
-}
-
-inline Int64 Milliseconds(Int64 time)
-{
- if (time < 0)
- return 0;
-
- return 1000 / Seconds(time);
-}
+ class HardwareTimer;
+ class HardwareTimerInterface;
+
+ class HardwareTimerInterface
+ {
+ public:
+ /// @brief Default constructor
+ explicit HardwareTimerInterface() = default;
+ virtual ~HardwareTimerInterface() = default;
+
+ public:
+ NEWOS_COPY_DEFAULT(HardwareTimerInterface);
+
+ public:
+ virtual Int32 Wait() noexcept;
+ };
+
+ class HardwareTimer final : public HardwareTimerInterface
+ {
+ public:
+ explicit HardwareTimer(Int64 seconds);
+ ~HardwareTimer() override;
+
+ public:
+ NEWOS_COPY_DEFAULT(HardwareTimer);
+
+ public:
+ Int32 Wait() noexcept override;
+
+ public:
+ IntPtr* fDigitalTimer{nullptr};
+ Int64 fWaitFor{0};
+ };
+
+ inline Int64 Seconds(Int64 time)
+ {
+ if (time < 0)
+ return 0;
+
+ return 1000 / time;
+ }
+
+ inline Int64 Milliseconds(Int64 time)
+ {
+ if (time < 0)
+ return 0;
+
+ return 1000 / Seconds(time);
+ }
} // namespace NewOS