aboutsummaryrefslogtreecommitdiffstats
path: root/funreg.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'funreg.hpp')
-rw-r--r--funreg.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/funreg.hpp b/funreg.hpp
index 6ca44ed..00cd3a9 100644
--- a/funreg.hpp
+++ b/funreg.hpp
@@ -46,7 +46,7 @@ struct MemoryIO {
constexpr static auto addr = Addr;
/**
- * Gets a pointer to the register.
+ * Reads the register's value.
*/
constexpr static T read() {
return *reinterpret_cast<volatile T*>(Addr);
@@ -392,7 +392,7 @@ struct RegisterMaskValue
* Tests if this value is currently set in the register.
*/
static bool test() {
- return Mask::read() & (value << BitOffset<Mask>);
+ return (Mask::read() & Mask::mask) == (value << BitOffset<Mask>);
}
};