diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 39475dd94a..4d3c90c8e3 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -654,6 +654,167 @@ bool dbg_partitions(void) | |||
654 | return false; | 654 | return false; |
655 | } | 655 | } |
656 | 656 | ||
657 | #ifdef CPU_COLDFIRE | ||
658 | bool dbg_spdif(void) | ||
659 | { | ||
660 | char buf[128]; | ||
661 | int button; | ||
662 | int line; | ||
663 | unsigned int control; | ||
664 | int x; | ||
665 | char *s; | ||
666 | int category; | ||
667 | int generation; | ||
668 | unsigned int interruptstat; | ||
669 | bool valnogood, symbolerr, parityerr; | ||
670 | |||
671 | lcd_setmargins(0, 0); | ||
672 | lcd_clear_display(); | ||
673 | lcd_setfont(FONT_SYSFIXED); | ||
674 | |||
675 | while(1) | ||
676 | { | ||
677 | line = 0; | ||
678 | |||
679 | control = EBU1RCVCCHANNEL1; | ||
680 | interruptstat = INTERRUPTSTAT; | ||
681 | INTERRUPTCLEAR = 0x03c00000; | ||
682 | |||
683 | valnogood = (interruptstat & 0x01000000)?true:false; | ||
684 | symbolerr = (interruptstat & 0x00800000)?true:false; | ||
685 | parityerr = (interruptstat & 0x00400000)?true:false; | ||
686 | |||
687 | snprintf(buf, sizeof(buf), "Val: %s Sym: %s Par: %s", | ||
688 | valnogood?"--":"OK", | ||
689 | symbolerr?"--":"OK", | ||
690 | parityerr?"--":"OK"); | ||
691 | lcd_puts(0, line++, buf); | ||
692 | |||
693 | snprintf(buf, sizeof(buf), "Status word: %08x", (int)control); | ||
694 | lcd_puts(0, line++, buf); | ||
695 | |||
696 | line++; | ||
697 | |||
698 | x = control >> 31; | ||
699 | snprintf(buf, sizeof(buf), "PRO: %d (%s)", | ||
700 | x, x?"Professional":"Consumer"); | ||
701 | lcd_puts(0, line++, buf); | ||
702 | |||
703 | x = (control >> 30) & 1; | ||
704 | snprintf(buf, sizeof(buf), "Audio: %d (%s)", | ||
705 | x, x?"Non-PCM":"PCM"); | ||
706 | lcd_puts(0, line++, buf); | ||
707 | |||
708 | x = (control >> 29) & 1; | ||
709 | snprintf(buf, sizeof(buf), "Copy: %d (%s)", | ||
710 | x, x?"Permitted":"Inhibited"); | ||
711 | lcd_puts(0, line++, buf); | ||
712 | |||
713 | x = (control >> 27) & 7; | ||
714 | switch(x) | ||
715 | { | ||
716 | case 0: | ||
717 | s = "None"; | ||
718 | break; | ||
719 | case 1: | ||
720 | s = "50/15us"; | ||
721 | break; | ||
722 | default: | ||
723 | s = "Reserved"; | ||
724 | break; | ||
725 | } | ||
726 | snprintf(buf, sizeof(buf), "Preemphasis: %d (%s)", x, s); | ||
727 | lcd_puts(0, line++, buf); | ||
728 | |||
729 | x = (control >> 24) & 3; | ||
730 | snprintf(buf, sizeof(buf), "Mode: %d", x); | ||
731 | lcd_puts(0, line++, buf); | ||
732 | |||
733 | category = (control >> 17) & 127; | ||
734 | switch(category) | ||
735 | { | ||
736 | case 0x00: | ||
737 | s = "General"; | ||
738 | break; | ||
739 | case 0x40: | ||
740 | s = "Audio CD"; | ||
741 | break; | ||
742 | default: | ||
743 | s = "Unknown"; | ||
744 | } | ||
745 | snprintf(buf, sizeof(buf), "Category: 0x%02x (%s)", category, s); | ||
746 | lcd_puts(0, line++, buf); | ||
747 | |||
748 | x = (control >> 16) & 1; | ||
749 | generation = x; | ||
750 | if(((category & 0x70) == 0x10) || | ||
751 | ((category & 0x70) == 0x40) || | ||
752 | ((category & 0x78) == 0x38)) | ||
753 | { | ||
754 | generation = !generation; | ||
755 | } | ||
756 | snprintf(buf, sizeof(buf), "Generation: %d (%s)", | ||
757 | x, generation?"Original":"No ind."); | ||
758 | lcd_puts(0, line++, buf); | ||
759 | |||
760 | x = (control >> 12) & 15; | ||
761 | snprintf(buf, sizeof(buf), "Source: %d", x); | ||
762 | lcd_puts(0, line++, buf); | ||
763 | |||
764 | x = (control >> 8) & 15; | ||
765 | switch(x) | ||
766 | { | ||
767 | case 0: | ||
768 | s = "Unspecified"; | ||
769 | break; | ||
770 | case 8: | ||
771 | s = "A (Left)"; | ||
772 | break; | ||
773 | case 4: | ||
774 | s = "B (Right)"; | ||
775 | break; | ||
776 | default: | ||
777 | s = ""; | ||
778 | break; | ||
779 | } | ||
780 | snprintf(buf, sizeof(buf), "Channel: %d (%s)", x, s); | ||
781 | lcd_puts(0, line++, buf); | ||
782 | |||
783 | x = (control >> 4) & 15; | ||
784 | switch(x) | ||
785 | { | ||
786 | case 0: | ||
787 | s = "44.1kHz"; | ||
788 | break; | ||
789 | case 0x4: | ||
790 | s = "48kHz"; | ||
791 | break; | ||
792 | case 0xc: | ||
793 | s = "32kHz"; | ||
794 | break; | ||
795 | } | ||
796 | snprintf(buf, sizeof(buf), "Frequency: %d (%s)", x, s); | ||
797 | lcd_puts(0, line++, buf); | ||
798 | |||
799 | x = (control >> 2) & 3; | ||
800 | snprintf(buf, sizeof(buf), "Clock accuracy: %d", x); | ||
801 | lcd_puts(0, line++, buf); | ||
802 | |||
803 | lcd_update(); | ||
804 | button = button_get_w_tmo(HZ/10); | ||
805 | |||
806 | switch(button) | ||
807 | { | ||
808 | case SETTINGS_CANCEL: | ||
809 | case SETTINGS_OK2: | ||
810 | return false; | ||
811 | } | ||
812 | } | ||
813 | |||
814 | return false; | ||
815 | } | ||
816 | #endif | ||
817 | |||
657 | #ifdef HAVE_LCD_BITMAP | 818 | #ifdef HAVE_LCD_BITMAP |
658 | /* Test code!!! */ | 819 | /* Test code!!! */ |
659 | bool dbg_ports(void) | 820 | bool dbg_ports(void) |
@@ -939,6 +1100,7 @@ bool dbg_cpufreq(void) | |||
939 | break; | 1100 | break; |
940 | 1101 | ||
941 | case SETTINGS_CANCEL: | 1102 | case SETTINGS_CANCEL: |
1103 | case SETTINGS_OK2: | ||
942 | return false; | 1104 | return false; |
943 | } | 1105 | } |
944 | } | 1106 | } |
@@ -1571,6 +1733,7 @@ bool debug_menu(void) | |||
1571 | #endif | 1733 | #endif |
1572 | #if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) | 1734 | #if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) |
1573 | { "PCM recording", pcm_rec_screen }, | 1735 | { "PCM recording", pcm_rec_screen }, |
1736 | { "S/PDIF analyzer", dbg_spdif }, | ||
1574 | #endif | 1737 | #endif |
1575 | #if CONFIG_CPU == SH7034 | 1738 | #if CONFIG_CPU == SH7034 |
1576 | { "Catch mem accesses", dbg_set_memory_guard }, | 1739 | { "Catch mem accesses", dbg_set_memory_guard }, |