diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2006-05-12 01:10:18 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2006-05-12 01:10:18 +0000 |
| commit | 073f1978e207b89618fb76710aa764b7bbd3cc97 (patch) | |
| tree | b7cab4c35932c2af3d777b2cf467ccaf29844b03 /apps | |
| parent | 2de6604e3ad75f48d3a9ee02e14b43a843999651 (diff) | |
| download | rockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.zip rockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.tar.gz rockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.tar.bz2 rockbox-073f1978e207b89618fb76710aa764b7bbd3cc97.tar.xz | |
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.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index f3dc368..3936594 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -718,7 +718,6 @@ bool dbg_partitions(void) bool dbg_spdif(void) { char buf[128]; - int button; int line; unsigned int control; int x; @@ -727,12 +726,17 @@ bool dbg_spdif(void) int generation; unsigned int interruptstat; bool valnogood, symbolerr, parityerr; + bool done = false; lcd_setmargins(0, 0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); +#ifdef HAVE_SPDIF_POWER + spdif_power_enable(true); /* We need SPDIF power for both sending & receiving */ +#endif + PHASECONFIG = 0x34; /* Gain = 3*2^13, source = EBUIN */ - while(1) + while (!done) { line = 0; @@ -855,21 +859,29 @@ bool dbg_spdif(void) } snprintf(buf, sizeof(buf), "Frequency: %d (%s)", x, s); lcd_puts(0, line++, buf); - + x = (control >> 2) & 3; snprintf(buf, sizeof(buf), "Clock accuracy: %d", x); lcd_puts(0, line++, buf); + line++; + snprintf(buf, sizeof(buf), "Measured freq: %ldHz", + (long)((long long)FREQMEAS*CPU_FREQ/((1 << 15)*3*(1 << 13))/128)); + lcd_puts(0, line++, buf); + lcd_update(); - button = button_get_w_tmo(HZ/10); - switch(button) + switch (button_get_w_tmo(HZ/10)) { - case SETTINGS_CANCEL: - case SETTINGS_OK2: - return false; + case SETTINGS_CANCEL: + case SETTINGS_OK2: + done = true; + break; } } +#ifdef HAVE_SPDIF_POWER + spdif_power_enable(global_settings.spdif_enable); +#endif return false; } |