use current pressed buttons when creating new controller

This commit is contained in:
Corwin Kuiper 2021-06-12 18:54:45 +01:00
parent 04e616a1bf
commit 9dedf26619

View file

@ -48,9 +48,10 @@ impl Default for ButtonController {
impl ButtonController {
pub fn new() -> Self {
let pressed = !unsafe { BUTTON_INPUT.read_volatile() };
ButtonController {
previous: 0,
current: 0,
previous: pressed,
current: pressed,
}
}