summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/main.c27
-rw-r--r--firmware/include/dircache.h2
2 files changed, 21 insertions, 8 deletions
diff --git a/apps/main.c b/apps/main.c
index 43ce9f4..a3fc267 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -99,6 +99,8 @@ void app_main(void)
void init_dircache(void)
{
int font_w, font_h;
+ int result;
+ char buf[32];
dircache_init();
if (global_settings.dircache)
@@ -109,13 +111,24 @@ void init_dircache(void)
LCD_HEIGHT-font_h*3, str(LANG_DIRCACHE_BUILDING));
lcd_update();
- dircache_build(global_settings.dircache_size);
-
- /* Clean the text when we are done. */
- lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
- lcd_fillrect(0, LCD_HEIGHT-font_h*3, LCD_WIDTH, font_h);
- lcd_set_drawmode(DRMODE_SOLID);
- lcd_update();
+ result = dircache_build(global_settings.dircache_size);
+ if (result < 0)
+ {
+ snprintf(buf, sizeof(buf),
+ "Failed! Result: %d",
+ result);
+ lcd_getstringsize("A", &font_w, &font_h);
+ lcd_putsxy((LCD_WIDTH/2) - ((strlen(buf)*font_w)/2),
+ LCD_HEIGHT-font_h*2, buf);
+ }
+ else
+ {
+ /* Clean the text when we are done. */
+ lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
+ lcd_fillrect(0, LCD_HEIGHT-font_h*3, LCD_WIDTH, font_h);
+ lcd_set_drawmode(DRMODE_SOLID);
+ lcd_update();
+ }
}
}
#else
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h
index 11d7335..62c5bcd 100644
--- a/firmware/include/dircache.h
+++ b/firmware/include/dircache.h
@@ -24,7 +24,7 @@
#ifdef HAVE_DIRCACHE
#define DIRCACHE_RESERVE (1024*64)
-#define DIRCACHE_LIMIT (1024*1024*2)
+#define DIRCACHE_LIMIT (1024*1024*3)
#define DIRCACHE_FILE ROCKBOX_DIR "/dircache.dat"
/* Internal structures. */