From ba5421cadd7ea81824dd3ef6c269aa98a725ffb1 Mon Sep 17 00:00:00 2001 From: Andy Killorin <37423245+Speedy6451@users.noreply.github.com> Date: Thu, 3 Apr 2025 10:56:53 -0400 Subject: [PATCH] handle buttons --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.c b/main.c index 4c11f3b..a46a2a8 100644 --- a/main.c +++ b/main.c @@ -83,6 +83,16 @@ int main(void) { IntMasterEnable(); while (true) { + // handle buttons + Button button = (Button) 0; + while (fifo_get(&button)) { + switch (button) { + case S2: + drawRequested = 1; + break; + } + } + GrContextForegroundSet(&sContext, ClrBlack); GrRectFill(&sContext, &rectFullScreen); // fill screen with black