Use GlobalTime
This commit is contained in:
@@ -36,6 +36,10 @@ namespace JabyEngine {
|
||||
Status.write(Status.read().clear_bit(irq));
|
||||
}
|
||||
|
||||
static void disable_irq(Bit<uint32_t> irq) {
|
||||
Mask.write(Mask.read().clear_bit(irq));
|
||||
}
|
||||
|
||||
static void enable_irq(Bit<uint32_t> irq) {
|
||||
Mask.write(Mask.read().set_bit(irq));
|
||||
}
|
||||
|
@@ -32,10 +32,11 @@ namespace JabyEngine {
|
||||
};
|
||||
|
||||
struct __no_align Timer {
|
||||
IOPort<uint32_t> value;
|
||||
IOPort<CounterMode> mode;
|
||||
IOPort<CounterTarget> target;
|
||||
private:
|
||||
uint32_t _unused[2];
|
||||
uint32_t _unused[1];
|
||||
};
|
||||
|
||||
namespace Counter0 {
|
||||
@@ -86,7 +87,7 @@ namespace JabyEngine {
|
||||
};
|
||||
}
|
||||
|
||||
__declare_io_port_global_array(Timer, Counter, 0x1F801104, 3);
|
||||
__declare_io_port_global_array(Timer, Counter, 0x1F801100, 3);
|
||||
static_assert(sizeof(Timer) == 0x10);
|
||||
}
|
||||
}
|
||||
|
@@ -13,14 +13,14 @@ namespace JabyEngine {
|
||||
|
||||
public:
|
||||
constexpr size_t milliseconds_to(const TimeStamp& ts) const {
|
||||
return (ts.value - this->value);
|
||||
return (ts.value - this->value)*10;
|
||||
}
|
||||
|
||||
friend class GlobalTime;
|
||||
};
|
||||
|
||||
private:
|
||||
static size_t global_counter;
|
||||
static volatile size_t global_counter;
|
||||
|
||||
public:
|
||||
GlobalTime() = delete;
|
||||
|
Reference in New Issue
Block a user