Kernel: Move RTC to Timer directory
PIT ms counter seems to be off by multiple seconds/minute. I will be probably changing to HPET for system time
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <BAN/Time.h>
|
||||
|
||||
namespace RTC
|
||||
{
|
||||
|
||||
BAN::Time get_current_time();
|
||||
|
||||
}
|
||||
19
kernel/include/kernel/Timer/RTC.h
Normal file
19
kernel/include/kernel/Timer/RTC.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <BAN/Time.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
class RTC
|
||||
{
|
||||
public:
|
||||
BAN::Time get_current_time();
|
||||
|
||||
private:
|
||||
bool is_update_in_progress();
|
||||
uint8_t read_register8(uint8_t reg);
|
||||
void get_time(BAN::Time& out);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <BAN/UniqPtr.h>
|
||||
#include <BAN/Vector.h>
|
||||
#include <kernel/Timer/RTC.h>
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
@@ -24,12 +25,16 @@ namespace Kernel
|
||||
uint64_t ms_since_boot() const;
|
||||
void sleep(uint64_t) const;
|
||||
|
||||
uint64_t get_unix_timestamp();
|
||||
|
||||
private:
|
||||
TimerHandler() = default;
|
||||
|
||||
void initialize_timers();
|
||||
|
||||
private:
|
||||
uint64_t m_boot_time { 0 };
|
||||
BAN::UniqPtr<RTC> m_rtc;
|
||||
BAN::Vector<BAN::UniqPtr<Timer>> m_timers;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user