summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-02-04 09:53:22 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-02-04 09:53:22 +0000
commit04f9cc79937a6939e800c646b4c8e9650898bd7e (patch)
treed9fbaa61c6740a03422113b4833aa81152c7624a /apps/debug_menu.c
parentfacfec0c7737b57cdaf6ef7e80d9b43571e975f1 (diff)
downloadrockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.zip
rockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.tar.gz
rockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.tar.bz2
rockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.tar.xz
Added a debug option for the FM radio detection
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4293 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 5f22776..78442dc 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -42,6 +42,7 @@
#include "settings.h"
#include "ata.h"
#include "fat.h"
+#include "radio.h"
#ifdef HAVE_LCD_BITMAP
#include "widgets.h"
#include "peakmeter.h"
@@ -1377,6 +1378,46 @@ bool dbg_save_roms(void)
return false;
}
+#ifdef HAVE_FMRADIO
+extern int debug_fm_detection;
+
+bool dbg_fm_radio(void)
+{
+ char buf[32];
+ int button;
+ bool fm_detected;
+
+#ifdef HAVE_LCD_BITMAP
+ lcd_setmargins(0, 0);
+#endif
+
+ while(1)
+ {
+ lcd_clear_display();
+ fm_detected = radio_hardware_present();
+
+ snprintf(buf, sizeof buf, "HW detected: %s", fm_detected?"yes":"no");
+ lcd_puts(0, 0, buf);
+ snprintf(buf, sizeof buf, "Result: %08x", debug_fm_detection);
+ lcd_puts(0, 1, buf);
+ lcd_update();
+
+ button = button_get(true);
+
+ switch(button)
+ {
+#ifdef HAVE_RECORDER_KEYPAD
+ case BUTTON_OFF:
+#else
+ case BUTTON_STOP:
+#endif
+ return false;
+ }
+ }
+ return false;
+}
+#endif
+
bool debug_menu(void)
{
int m;
@@ -1411,6 +1452,9 @@ bool debug_menu(void)
#endif /* PM_DEBUG */
#endif /* HAVE_LCD_BITMAP */
{ "View runtime", view_runtime },
+#ifdef HAVE_FMRADIO
+ { "FM Radio", dbg_fm_radio },
+#endif
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );