From 2f74eaae81a64c451da2f5650fbbbd8ce1fcc60b Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 14 Oct 2002 14:13:48 +0000 Subject: [PATCH] Added dbg_mpeg_thread() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2624 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index dca95d6cf7..77f896d7df 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -37,6 +37,7 @@ #include "system.h" #include "font.h" #include "disk.h" +#include "mpeg.h" /*---------------------------------------------------*/ /* SPECIAL DEBUG STUFF */ @@ -131,6 +132,45 @@ bool dbg_os(void) } #endif +#ifdef HAVE_LCD_BITMAP +bool dbg_mpeg_thread(void) +{ + char buf[32]; + int button; + struct mpeg_debug d; + + while(1) + { + button = button_get_w_tmo(HZ/5); + switch(button) + { + case BUTTON_OFF | BUTTON_REL: + return false; + } + + mpeg_get_debugdata(&d); + + lcd_clear_display(); + + snprintf(buf, sizeof(buf), "read: %x", d.mp3buf_read); + lcd_puts(0, 0, buf); + snprintf(buf, sizeof(buf), "write: %x", d.mp3buf_write); + lcd_puts(0, 1, buf); + snprintf(buf, sizeof(buf), "swap: %x", d.mp3buf_swapwrite); + lcd_puts(0, 2, buf); + snprintf(buf, sizeof(buf), "playing: %d", d.playing); + lcd_puts(0, 3, buf); + snprintf(buf, sizeof(buf), "unplayed: %x", d.unplayed_space); + lcd_puts(0, 4, buf); + snprintf(buf, sizeof(buf), "unswapped: %x", d.unswapped_space); + lcd_puts(0, 5, buf); + + lcd_update(); + } + return false; +} +#endif + #ifdef HAVE_LCD_BITMAP bool dbg_hw_info(void) { @@ -968,6 +1008,9 @@ bool debug_menu(void) #endif { "View HW info", dbg_hw_info }, { "View partitions", dbg_partitions }, +#ifdef HAVE_LCD_BITMAP + { "View mpeg thread", dbg_mpeg_thread }, +#endif }; m=menu_init( items, sizeof items / sizeof(struct menu_items) );