From 722e0fad359cec133f6d74d22b8acc9d0dc3f0e1 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Mon, 8 Mar 2021 04:43:36 +0000 Subject: [PATCH] invert fully rather than inverting button bits --- src/input.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/input.rs b/src/input.rs index 53d2220b..cd686dd5 100644 --- a/src/input.rs +++ b/src/input.rs @@ -30,8 +30,6 @@ bitflags! { } } -const KEY_MASK: u16 = 0b1111111111; - const BUTTON_INPUT: *mut u16 = (0x04000130) as *mut u16; // const BUTTON_INTURRUPT: *mut u16 = (0x04000132) as *mut u16; @@ -57,7 +55,7 @@ impl ButtonController { pub fn update(&mut self) { self.previous = self.current; - self.current = unsafe { BUTTON_INPUT.read_volatile() } ^ KEY_MASK; + self.current = !unsafe { BUTTON_INPUT.read_volatile() }; } pub fn x_tri(&self) -> Tri {