rendered paste bodyIndex: bootloader/common.c
===================================================================
--- bootloader/common.c (revision 12629)
+++ bootloader/common.c (working copy)
@@ -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 @@
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
Index: bootloader/ipod.c
===================================================================
--- bootloader/ipod.c (revision 12629)
+++ bootloader/ipod.c (working copy)
@@ -223,6 +223,7 @@
{
char buf[256];
int i;
+ int btn;
int rc;
bool haveretailos;
bool button_was_held;
@@ -278,7 +279,12 @@
button_init();
#endif
+ btn=key_pressed();
+ /* Enable bootloader messages */
+ if (btn==BUTTON_RIGHT)
+ verbose = true;
+
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
@@ -314,10 +320,7 @@
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 @@
/* 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) {
Index: bootloader/common.h
===================================================================
--- bootloader/common.h (revision 12629)
+++ bootloader/common.h (working copy)
@@ -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, ...);