Clear MainVolume and improve port code
This commit is contained in:
@@ -52,13 +52,13 @@ public:
|
||||
|
||||
template<typename S>
|
||||
constexpr IOPort<T>& clear_bit(S bit) {
|
||||
this->value = bit::set(this->value, static_cast<size_t>(bit));
|
||||
this->value = bit::clear(this->value, static_cast<size_t>(bit));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
constexpr void clear_bit(S bit) volatile {
|
||||
this->value = bit::set(this->value, static_cast<size_t>(bit));
|
||||
this->value = bit::clear(this->value, static_cast<size_t>(bit));
|
||||
}
|
||||
|
||||
template<typename S>
|
||||
@@ -164,4 +164,10 @@ static constexpr uintptr_t IO_Base_Mask = 0xF0000000;
|
||||
static constexpr uintptr_t IO_Base_Adr = 0x10000000;
|
||||
|
||||
#define __declare_io_port_global(type, name, adr) static __always_inline auto& name = *reinterpret_cast<IOPort<type>*>((IO_Base_Adr + (adr & ~IO_Base_Mask)))
|
||||
#define __io_port_inherit(name) \
|
||||
using IOPort::operator=; \
|
||||
constexpr name() = default; \
|
||||
constexpr name(IOPort value) : IOPort(value) { \
|
||||
}
|
||||
|
||||
#endif //!__JABYENGINE_IOPORT_HPP__
|
||||
Reference in New Issue
Block a user