From 8f280a30f3f4a0a51cd4964b08286ca29d514eda Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sat, 26 Nov 2005 20:22:19 +0000 Subject: Debug menu entry for the dircache. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8071 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'apps') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 1364637ab0..14cdd6cec7 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1668,6 +1668,56 @@ static bool dbg_disk_info(void) } #endif /* !HAVE_MMC */ +#ifdef HAVE_DIRCACHE +static bool dbg_dircache_info(void) +{ + bool done = false; + int line; + char buf[32]; + + lcd_setmargins(0, 0); + lcd_setfont(FONT_SYSFIXED); + + while (!done) + { + line = 0; + + lcd_clear_display(); + snprintf(buf, sizeof(buf), "Cache initialized: %s", + dircache_is_enabled() ? "Yes" : "No"); + lcd_puts(0, line++, buf); + + snprintf(buf, sizeof(buf), "Cache size: %d B", + dircache_get_cache_size()); + lcd_puts(0, line++, buf); + + snprintf(buf, sizeof(buf), "Last size: %d B", + global_settings.dircache_size); + lcd_puts(0, line++, buf); + + snprintf(buf, sizeof(buf), "Limit: %d B", DIRCACHE_LIMIT); + lcd_puts(0, line++, buf); + + snprintf(buf, sizeof(buf), "Reserve: %d/%d B", + dircache_get_reserve_used(), DIRCACHE_RESERVE); + lcd_puts(0, line++, buf); + + lcd_update(); + + switch (button_get_w_tmo(HZ/2)) + { + case SETTINGS_OK: + case SETTINGS_CANCEL: + done = true; + break; + } + } + + return false; +} + +#endif /* HAVE_DIRCACHE */ + #if CONFIG_CPU == SH7034 bool dbg_save_roms(void) { @@ -1804,6 +1854,9 @@ bool debug_menu(void) #else { "View disk info", dbg_disk_info }, #endif +#ifdef HAVE_DIRCACHE + { "View dircache info", dbg_dircache_info }, +#endif #ifdef HAVE_LCD_BITMAP { "View audio thread", dbg_audio_thread }, #ifdef PM_DEBUG -- cgit v1.2.3