Support easier read
This commit is contained in:
parent
a4fb2d008b
commit
8c9c4f1404
|
@ -14,6 +14,11 @@ namespace JabyEngine {
|
||||||
return const_cast<const volatile IOPort<T>*>(this)->value;
|
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>
|
template<typename...ARGS>
|
||||||
constexpr void write_combined(const ARGS&... value) {
|
constexpr void write_combined(const ARGS&... value) {
|
||||||
IOPort::write(T::with(value...));
|
IOPort::write(T::with(value...));
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace JabyEngine {
|
||||||
~HighResTime() = delete;
|
~HighResTime() = delete;
|
||||||
|
|
||||||
static TimeStamp get_time_stamp() {
|
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
|
#endif //JABYENGINE_USE_HIGH_PERCISION_TIMER
|
||||||
|
|
Loading…
Reference in New Issue