diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-02-04 09:53:22 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-02-04 09:53:22 +0000 |
commit | 04f9cc79937a6939e800c646b4c8e9650898bd7e (patch) | |
tree | d9fbaa61c6740a03422113b4833aa81152c7624a /apps/debug_menu.c | |
parent | facfec0c7737b57cdaf6ef7e80d9b43571e975f1 (diff) | |
download | rockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.tar.gz rockbox-04f9cc79937a6939e800c646b4c8e9650898bd7e.zip |
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.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 5f22776a4b..78442dcf9c 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "settings.h" | 42 | #include "settings.h" |
43 | #include "ata.h" | 43 | #include "ata.h" |
44 | #include "fat.h" | 44 | #include "fat.h" |
45 | #include "radio.h" | ||
45 | #ifdef HAVE_LCD_BITMAP | 46 | #ifdef HAVE_LCD_BITMAP |
46 | #include "widgets.h" | 47 | #include "widgets.h" |
47 | #include "peakmeter.h" | 48 | #include "peakmeter.h" |
@@ -1377,6 +1378,46 @@ bool dbg_save_roms(void) | |||
1377 | return false; | 1378 | return false; |
1378 | } | 1379 | } |
1379 | 1380 | ||
1381 | #ifdef HAVE_FMRADIO | ||
1382 | extern int debug_fm_detection; | ||
1383 | |||
1384 | bool dbg_fm_radio(void) | ||
1385 | { | ||
1386 | char buf[32]; | ||
1387 | int button; | ||
1388 | bool fm_detected; | ||
1389 | |||
1390 | #ifdef HAVE_LCD_BITMAP | ||
1391 | lcd_setmargins(0, 0); | ||
1392 | #endif | ||
1393 | |||
1394 | while(1) | ||
1395 | { | ||
1396 | lcd_clear_display(); | ||
1397 | fm_detected = radio_hardware_present(); | ||
1398 | |||
1399 | snprintf(buf, sizeof buf, "HW detected: %s", fm_detected?"yes":"no"); | ||
1400 | lcd_puts(0, 0, buf); | ||
1401 | snprintf(buf, sizeof buf, "Result: %08x", debug_fm_detection); | ||
1402 | lcd_puts(0, 1, buf); | ||
1403 | lcd_update(); | ||
1404 | |||
1405 | button = button_get(true); | ||
1406 | |||
1407 | switch(button) | ||
1408 | { | ||
1409 | #ifdef HAVE_RECORDER_KEYPAD | ||
1410 | case BUTTON_OFF: | ||
1411 | #else | ||
1412 | case BUTTON_STOP: | ||
1413 | #endif | ||
1414 | return false; | ||
1415 | } | ||
1416 | } | ||
1417 | return false; | ||
1418 | } | ||
1419 | #endif | ||
1420 | |||
1380 | bool debug_menu(void) | 1421 | bool debug_menu(void) |
1381 | { | 1422 | { |
1382 | int m; | 1423 | int m; |
@@ -1411,6 +1452,9 @@ bool debug_menu(void) | |||
1411 | #endif /* PM_DEBUG */ | 1452 | #endif /* PM_DEBUG */ |
1412 | #endif /* HAVE_LCD_BITMAP */ | 1453 | #endif /* HAVE_LCD_BITMAP */ |
1413 | { "View runtime", view_runtime }, | 1454 | { "View runtime", view_runtime }, |
1455 | #ifdef HAVE_FMRADIO | ||
1456 | { "FM Radio", dbg_fm_radio }, | ||
1457 | #endif | ||
1414 | }; | 1458 | }; |
1415 | 1459 | ||
1416 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 1460 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); |