From ddd6a2865db5c73a4bb9d486f71a8c2f1f96ec69 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 9 Jun 2009 12:22:33 -0700 Subject: split out device-specific recovery UI code into vendor directories Take some device-specific details of the recovery UI (eg, what keys to press to bring up the interface and perform actions, exact text of the menu, etc.) and split them out into separate C functions. Arrange to take implementations of those functions from the appropriate vendor directory at build time. Provide a default implementation in case no vendor-specific one is available. --- ui.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'ui.c') diff --git a/ui.c b/ui.c index b84f1722f..039d682f2 100644 --- a/ui.c +++ b/ui.c @@ -307,20 +307,14 @@ static void *input_thread(void *cookie) } pthread_mutex_unlock(&key_queue_mutex); - // Alt+L or Home+End: toggle log display - int alt = key_pressed[KEY_LEFTALT] || key_pressed[KEY_RIGHTALT]; - if ((alt && ev.code == KEY_L && ev.value > 0) || - (key_pressed[KEY_HOME] && ev.code == KEY_END && ev.value > 0)) { + if (ev.value > 0 && device_toggle_display(key_pressed, ev.code)) { pthread_mutex_lock(&gUpdateMutex); show_text = !show_text; update_screen_locked(); pthread_mutex_unlock(&gUpdateMutex); } - // Green+Menu+Red: reboot immediately - if (ev.code == KEY_DREAM_RED && - key_pressed[KEY_DREAM_MENU] && - key_pressed[KEY_DREAM_GREEN]) { + if (ev.value > 0 && device_reboot_now(key_pressed, ev.code)) { reboot(RB_AUTOBOOT); } } -- cgit v1.2.3