summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/src
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel/src')
-rw-r--r--dev/Kernel/src/KernelMain.cc1
-rw-r--r--dev/Kernel/src/SoftwareTimer.cc39
-rw-r--r--dev/Kernel/src/Timer.cc32
3 files changed, 41 insertions, 31 deletions
diff --git a/dev/Kernel/src/KernelMain.cc b/dev/Kernel/src/KernelMain.cc
index d3498f24..fdbda512 100644
--- a/dev/Kernel/src/KernelMain.cc
+++ b/dev/Kernel/src/KernelMain.cc
@@ -22,7 +22,6 @@
#include <NewKit/Utils.h>
#include <KernelKit/CodeMgr.h>
#include <CFKit/Property.h>
-#include <Modules/GfxMgr/AppearanceMgr.h>
#include <KernelKit/Timer.h>
namespace Kernel::Detail
diff --git a/dev/Kernel/src/SoftwareTimer.cc b/dev/Kernel/src/SoftwareTimer.cc
new file mode 100644
index 00000000..797722d3
--- /dev/null
+++ b/dev/Kernel/src/SoftwareTimer.cc
@@ -0,0 +1,39 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024, Theater Quality Inc, all rights reserved.
+
+------------------------------------------- */
+
+#include <KernelKit/Timer.h>
+
+/// @brief SoftwareTimer class, meant to be generic.
+
+using namespace Kernel;
+
+SoftwareTimer::SoftwareTimer(Int64 seconds)
+ : fWaitFor(seconds)
+{
+ fDigitalTimer = new IntPtr();
+ MUST_PASS(fDigitalTimer);
+}
+
+SoftwareTimer::~SoftwareTimer()
+{
+ delete fDigitalTimer;
+ fDigitalTimer = nullptr;
+
+ fWaitFor = 0;
+}
+
+BOOL SoftwareTimer::Wait() noexcept
+{
+ if (fWaitFor < 1)
+ return NO;
+
+ while (*fDigitalTimer < (*fDigitalTimer + fWaitFor))
+ {
+ ++(*fDigitalTimer);
+ }
+
+ return YES;
+}
diff --git a/dev/Kernel/src/Timer.cc b/dev/Kernel/src/Timer.cc
index 8795dd66..d304f6ee 100644
--- a/dev/Kernel/src/Timer.cc
+++ b/dev/Kernel/src/Timer.cc
@@ -13,35 +13,7 @@
using namespace Kernel;
/// @brief Unimplemented as it is an interface.
-Int32 TimerInterface::Wait() noexcept
+BOOL TimerInterface::Wait() noexcept
{
- return kErrorUnimplemented;
-}
-
-/// @brief SoftwareTimer class, meant to be generic.
-
-SoftwareTimer::SoftwareTimer(Int64 seconds)
- : fWaitFor(seconds)
-{
- fDigitalTimer = new IntPtr();
- MUST_PASS(fDigitalTimer);
-}
-
-SoftwareTimer::~SoftwareTimer()
-{
- delete fDigitalTimer;
- fWaitFor = 0;
-}
-
-Int32 SoftwareTimer::Wait() noexcept
-{
- if (fWaitFor < 1)
- return 1;
-
- while (*fDigitalTimer < (*fDigitalTimer + fWaitFor))
- {
- ++(*fDigitalTimer);
- }
-
- return 0;
+ return NO;
}