summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/screens.c b/apps/screens.c
index 28d9a48869..c099822525 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -39,6 +39,7 @@
39#include "adc.h" 39#include "adc.h"
40#include "action.h" 40#include "action.h"
41#include "talk.h" 41#include "talk.h"
42#include "misc.h"
42 43
43#ifdef HAVE_LCD_BITMAP 44#ifdef HAVE_LCD_BITMAP
44#define BMPHEIGHT_usb_logo 32 45#define BMPHEIGHT_usb_logo 32
@@ -1090,3 +1091,41 @@ bool set_time_screen(char* string, struct tm *tm)
1090 return false; 1091 return false;
1091} 1092}
1092#endif 1093#endif
1094
1095bool shutdown_screen(void)
1096{
1097 int button;
1098 bool done = false;
1099
1100 lcd_stop_scroll();
1101
1102#ifdef HAVE_LCD_CHARCELLS
1103 splash(0, true, "Push STOP to shut off");
1104#else
1105 splash(0, true, "Push OFF to shut off");
1106#endif
1107 while(!done)
1108 {
1109 button = button_get_w_tmo(HZ*2);
1110 switch(button)
1111 {
1112#ifdef HAVE_PLAYER_KEYPAD
1113 case BUTTON_STOP:
1114#else
1115 case BUTTON_OFF:
1116#endif
1117 clean_shutdown();
1118 break;
1119
1120 default:
1121 /* Return if any other button was pushed, or if there
1122 was a timeout. We ignore RELEASE events, since we may
1123 have been called by a button down event, and the user might
1124 not have released the button yet. */
1125 if(!(button & BUTTON_REL))
1126 done = true;
1127 break;
1128 }
1129 }
1130 return false;
1131}