This commit is contained in:
2024-09-29 17:27:23 +02:00
parent 5292b7bf9f
commit 6680c4d5a3
18 changed files with 167 additions and 173 deletions

View File

@@ -3,16 +3,16 @@
namespace JabyEngine {
namespace Timer_IO {
using CounterModeIO = IOPort<Timer_IO_Values::CounterMode>;
using CounterTargetIO = IOPort<Timer_IO_Values::CounterTarget>;
using CounterValueIO = IOPort<Timer_IO_Values::CounterValue>;
using CounterMode_IO = IOPort<Timer_IO_Values::CounterMode>;
using CounterTarget_IO = IOPort<Timer_IO_Values::CounterTarget>;
using CounterValue_IO = IOPort<Timer_IO_Values::CounterValue>;
#pragma pack(push, 1)
struct Counter {
CounterValueIO value;
CounterModeIO mode;
CounterTargetIO target;
uint32_t unused;
CounterValue_IO value;
CounterMode_IO mode;
CounterTarget_IO target;
uint32_t unused;
inline uint16_t get_current_value() const {
return this->value.read().get(Timer_IO_Values::CounterValue::Value);
@@ -83,8 +83,8 @@ namespace JabyEngine {
}
// TODO: Improve this to actually use it for measurement - if possible
static auto& Counter0 = __new_declare_io_value(struct Counter0, counter_base_adr(0));
static auto& Counter1 = __new_declare_io_value(struct Counter1, counter_base_adr(1));
static auto& Counter2 = __new_declare_io_value(struct Counter2, counter_base_adr(2));
static auto& Counter0 = __declare_io_value(struct Counter0, counter_base_adr(0));
static auto& Counter1 = __declare_io_value(struct Counter1, counter_base_adr(1));
static auto& Counter2 = __declare_io_value(struct Counter2, counter_base_adr(2));
}
}