summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-03-05 23:56:28 +0000
committerDave Chapman <dave@dchapman.com>2007-03-05 23:56:28 +0000
commit4d25bffc8ac075d30fff780ab682ebbec29c2a46 (patch)
tree5980a79a8d19e2f06061a14d87a86034dc94d375
parente70362d106b38514ae73593b8286b10324a9b559 (diff)
downloadrockbox-4d25bffc8ac075d30fff780ab682ebbec29c2a46.tar.gz
rockbox-4d25bffc8ac075d30fff780ab682ebbec29c2a46.tar.bz2
rockbox-4d25bffc8ac075d30fff780ab682ebbec29c2a46.zip
Disable bootloader messages in the ipod bootloader unless the RIGHT button is being held. Messages are still displayed if an error occurs. This needs implementing for the other bootloaders.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12631 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/common.c15
-rw-r--r--bootloader/common.h3
-rw-r--r--bootloader/ipod.c13
3 files changed, 24 insertions, 7 deletions
diff --git a/bootloader/common.c b/bootloader/common.c
index 1d0ad360be..5f824cf1b8 100644
--- a/bootloader/common.c
+++ b/bootloader/common.c
@@ -22,9 +22,18 @@
#include "system.h"
#include <stdarg.h>
#include <stdio.h>
+#include <stdbool.h>
#include "cpu.h"
#include "common.h"
+/* TODO: Other bootloaders need to be adjusted to set this variable to true
+ on a button press - currently only the ipod version does. */
+#ifdef IPOD_ARCH
+bool verbose = false;
+#else
+bool verbose = true;
+#endif
+
int line = 0;
#ifdef HAVE_REMOTE_LCD
int remote_line = 0;
@@ -54,12 +63,14 @@ void printf(const char *format, ...)
va_end(ap);
lcd_puts(0, line++, ptr);
- lcd_update();
+ if (verbose)
+ lcd_update();
if(line >= LCD_HEIGHT/SYSFONT_HEIGHT)
line = 0;
#ifdef HAVE_REMOTE_LCD
lcd_remote_puts(0, remote_line++, ptr);
- lcd_remote_update();
+ if (verbose)
+ lcd_remote_update();
if(remote_line >= LCD_REMOTE_HEIGHT/SYSFONT_HEIGHT)
remote_line = 0;
#endif
diff --git a/bootloader/common.h b/bootloader/common.h
index 7e001aa9ab..c72952e562 100644
--- a/bootloader/common.h
+++ b/bootloader/common.h
@@ -26,6 +26,9 @@
#define EBAD_CHKSUM -5
#define EFILE_TOO_BIG -6
+/* Set this to true to enable lcd_update() in the printf function */
+extern bool verbose;
+
/* Functions common to all bootloaders */
void reset_screen(void);
void printf(const char *format, ...);
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index 0600ea62c1..8c0d4faa85 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -223,6 +223,7 @@ void* main(void)
{
char buf[256];
int i;
+ int btn;
int rc;
bool haveretailos;
bool button_was_held;
@@ -278,6 +279,11 @@ void* main(void)
button_init();
#endif
+ btn=key_pressed();
+
+ /* Enable bootloader messages */
+ if (btn==BUTTON_RIGHT)
+ verbose = true;
lcd_setfont(FONT_SYSFIXED);
@@ -314,10 +320,7 @@ void* main(void)
pinfo->type, pinfo->size / 2048);
- /* Check for a keypress */
- i=key_pressed();
-
- if (button_was_held || (i==BUTTON_MENU)) {
+ if (button_was_held || (btn==BUTTON_MENU)) {
/* If either the hold switch was on, or the Menu button was held, then
try the Apple firmware */
@@ -349,7 +352,7 @@ void* main(void)
/* Everything failed - just loop forever */
printf("No RetailOS detected");
- } else if (i==BUTTON_PLAY) {
+ } else if (btn==BUTTON_PLAY) {
printf("Loading Linux...");
rc=load_raw_firmware(loadbuffer, "/linux.bin", MAX_LOADSIZE);
if (rc < EOK) {