From 362b28e9372d124ac6602bfc49e9775e510ba929 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 27 Jan 2013 00:30:48 -0500 Subject: Suspend on lid-close in the menu. --- source/nds/gui.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source') diff --git a/source/nds/gui.c b/source/nds/gui.c index 93b3e7b..ece310c 100644 --- a/source/nds/gui.c +++ b/source/nds/gui.c @@ -324,6 +324,21 @@ gui_action_type get_gui_input(void) key = getKey(); + if (key & KEY_LID) + { + ds2_setSupend(); + struct key_buf inputdata; + do { + ds2_getrawInput(&inputdata); + mdelay(1); + } while (inputdata.key & KEY_LID); + ds2_wakeup(); + // In the menu, the lower screen's backlight needs to be on, + // and it is on right away after resuming from suspend. + // mdelay(100); // needed to avoid ds2_setBacklight crashing + // ds2_setBacklight(3); + } + switch(key) { case KEY_UP: -- cgit v1.2.3