Support easier read

This commit is contained in:
jaby 2023-01-10 21:12:41 +01:00
parent 101fdd9299
commit bc7e00a105
2 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,11 @@ namespace JabyEngine {
return const_cast<const volatile IOPort<T>*>(this)->value;
}
template<typename S>
constexpr S read(const BitRange<S>& range) const {
return IOPort::read().get_value(range);
}
template<typename...ARGS>
constexpr void write_combined(const ARGS&... value) {
IOPort::write(T::with(value...));

View File

@ -66,7 +66,7 @@ namespace JabyEngine {
~HighResTime() = delete;
static TimeStamp get_time_stamp() {
return TimeStamp(HighResTime::global_counter_10ms, Timer_IO::Counter2.value.read().get_value(Timer_IO::CounterValue::Value));
return TimeStamp(HighResTime::global_counter_10ms, Timer_IO::Counter2.value.read(Timer_IO::CounterValue::Value));
}
};
#endif //JABYENGINE_USE_HIGH_PERCISION_TIMER