diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 72 |
1 files changed, 54 insertions, 18 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 7b81869e69..fcd7e01181 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -691,24 +691,6 @@ bool dbg_ports(void) | |||
691 | 691 | ||
692 | switch(button) | 692 | switch(button) |
693 | { | 693 | { |
694 | case BUTTON_UP: | ||
695 | cpu_boost(true); | ||
696 | snprintf(buf, sizeof(buf), "freq: %ld, IDECONFIG1: %08lx, IDECONFIG2: %08lx", FREQ, IDECONFIG1, IDECONFIG2); | ||
697 | splash(HZ, false, buf); | ||
698 | break; | ||
699 | |||
700 | case BUTTON_DOWN: | ||
701 | cpu_boost(false); | ||
702 | snprintf(buf, sizeof(buf), "freq: %ld, IDECONFIG1: %08lx, IDECONFIG2: %08lx", FREQ, IDECONFIG1, IDECONFIG2); | ||
703 | splash(HZ, false, buf); | ||
704 | break; | ||
705 | |||
706 | case BUTTON_SELECT: | ||
707 | set_cpu_frequency(CPUFREQ_DEFAULT); | ||
708 | snprintf(buf, sizeof(buf), "freq: %ld, IDECONFIG1: %08lx, IDECONFIG2: %08lx", FREQ, IDECONFIG1, IDECONFIG2); | ||
709 | splash(HZ, false, buf); | ||
710 | break; | ||
711 | |||
712 | case SETTINGS_CANCEL: | 694 | case SETTINGS_CANCEL: |
713 | return false; | 695 | return false; |
714 | } | 696 | } |
@@ -811,6 +793,57 @@ bool dbg_ports(void) | |||
811 | } | 793 | } |
812 | #endif | 794 | #endif |
813 | 795 | ||
796 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
797 | extern int boost_counter; | ||
798 | bool dbg_cpufreq(void) | ||
799 | { | ||
800 | char buf[128]; | ||
801 | int line; | ||
802 | int button; | ||
803 | |||
804 | #ifdef HAVE_LCD_BITMAP | ||
805 | lcd_setmargins(0, 0); | ||
806 | #endif | ||
807 | lcd_clear_display(); | ||
808 | lcd_setfont(FONT_SYSFIXED); | ||
809 | |||
810 | while(1) | ||
811 | { | ||
812 | line = 0; | ||
813 | |||
814 | snprintf(buf, sizeof(buf), "Frequency: %ld", FREQ); | ||
815 | lcd_puts(0, line++, buf); | ||
816 | |||
817 | snprintf(buf, sizeof(buf), "boost_counter: %d", boost_counter); | ||
818 | lcd_puts(0, line++, buf); | ||
819 | |||
820 | lcd_update(); | ||
821 | button = button_get_w_tmo(HZ/10); | ||
822 | |||
823 | switch(button) | ||
824 | { | ||
825 | case BUTTON_UP: | ||
826 | cpu_boost(true); | ||
827 | break; | ||
828 | |||
829 | case BUTTON_DOWN: | ||
830 | cpu_boost(false); | ||
831 | break; | ||
832 | |||
833 | case BUTTON_SELECT: | ||
834 | set_cpu_frequency(CPUFREQ_DEFAULT); | ||
835 | boost_counter = 0; | ||
836 | break; | ||
837 | |||
838 | case SETTINGS_CANCEL: | ||
839 | return false; | ||
840 | } | ||
841 | } | ||
842 | |||
843 | return false; | ||
844 | } | ||
845 | #endif | ||
846 | |||
814 | #ifdef HAVE_RTC | 847 | #ifdef HAVE_RTC |
815 | /* Read RTC RAM contents and display them */ | 848 | /* Read RTC RAM contents and display them */ |
816 | bool dbg_rtc(void) | 849 | bool dbg_rtc(void) |
@@ -1754,6 +1787,9 @@ bool debug_menu(void) | |||
1754 | #if CONFIG_CPU == SH7034 || CONFIG_CPU == MCF5249 | 1787 | #if CONFIG_CPU == SH7034 || CONFIG_CPU == MCF5249 |
1755 | { "View I/O ports", dbg_ports }, | 1788 | { "View I/O ports", dbg_ports }, |
1756 | #endif | 1789 | #endif |
1790 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
1791 | { "CPU frequency", dbg_cpufreq }, | ||
1792 | #endif | ||
1757 | #if CONFIG_CPU == SH7034 | 1793 | #if CONFIG_CPU == SH7034 |
1758 | #ifdef HAVE_LCD_BITMAP | 1794 | #ifdef HAVE_LCD_BITMAP |
1759 | #ifdef HAVE_RTC | 1795 | #ifdef HAVE_RTC |