summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-05-12 01:10:18 +0000
committerJens Arnold <amiconn@rockbox.org>2006-05-12 01:10:18 +0000
commit073f1978e207b89618fb76710aa764b7bbd3cc97 (patch)
treeb7cab4c35932c2af3d777b2cf467ccaf29844b03 /apps
parent2de6604e3ad75f48d3a9ee02e14b43a843999651 (diff)
downloadrockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.tar.gz
rockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.zip
H1x0: Add SPDIF power control and frequency measurement to the SPDIF monitor.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9919 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index f3dc368d18..3936594954 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -718,7 +718,6 @@ bool dbg_partitions(void)
718bool dbg_spdif(void) 718bool dbg_spdif(void)
719{ 719{
720 char buf[128]; 720 char buf[128];
721 int button;
722 int line; 721 int line;
723 unsigned int control; 722 unsigned int control;
724 int x; 723 int x;
@@ -727,12 +726,17 @@ bool dbg_spdif(void)
727 int generation; 726 int generation;
728 unsigned int interruptstat; 727 unsigned int interruptstat;
729 bool valnogood, symbolerr, parityerr; 728 bool valnogood, symbolerr, parityerr;
729 bool done = false;
730 730
731 lcd_setmargins(0, 0); 731 lcd_setmargins(0, 0);
732 lcd_clear_display(); 732 lcd_clear_display();
733 lcd_setfont(FONT_SYSFIXED); 733 lcd_setfont(FONT_SYSFIXED);
734#ifdef HAVE_SPDIF_POWER
735 spdif_power_enable(true); /* We need SPDIF power for both sending & receiving */
736#endif
737 PHASECONFIG = 0x34; /* Gain = 3*2^13, source = EBUIN */
734 738
735 while(1) 739 while (!done)
736 { 740 {
737 line = 0; 741 line = 0;
738 742
@@ -855,21 +859,29 @@ bool dbg_spdif(void)
855 } 859 }
856 snprintf(buf, sizeof(buf), "Frequency: %d (%s)", x, s); 860 snprintf(buf, sizeof(buf), "Frequency: %d (%s)", x, s);
857 lcd_puts(0, line++, buf); 861 lcd_puts(0, line++, buf);
858 862
859 x = (control >> 2) & 3; 863 x = (control >> 2) & 3;
860 snprintf(buf, sizeof(buf), "Clock accuracy: %d", x); 864 snprintf(buf, sizeof(buf), "Clock accuracy: %d", x);
861 lcd_puts(0, line++, buf); 865 lcd_puts(0, line++, buf);
866 line++;
862 867
868 snprintf(buf, sizeof(buf), "Measured freq: %ldHz",
869 (long)((long long)FREQMEAS*CPU_FREQ/((1 << 15)*3*(1 << 13))/128));
870 lcd_puts(0, line++, buf);
871
863 lcd_update(); 872 lcd_update();
864 button = button_get_w_tmo(HZ/10);
865 873
866 switch(button) 874 switch (button_get_w_tmo(HZ/10))
867 { 875 {
868 case SETTINGS_CANCEL: 876 case SETTINGS_CANCEL:
869 case SETTINGS_OK2: 877 case SETTINGS_OK2:
870 return false; 878 done = true;
879 break;
871 } 880 }
872 } 881 }
882#ifdef HAVE_SPDIF_POWER
883 spdif_power_enable(global_settings.spdif_enable);
884#endif
873 885
874 return false; 886 return false;
875} 887}