summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-03-01 14:40:27 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-03-01 14:40:27 +0000
commitaceef07c87ded3768b653f3501af01bd3490e93c (patch)
treecd898a9fabd49bfb3f7454ab71410dd4a1d43c5d /apps
parent8fb87425f0137f6edb47f321087aa34f3c7af7aa (diff)
downloadrockbox-aceef07c87ded3768b653f3501af01bd3490e93c.tar.gz
rockbox-aceef07c87ded3768b653f3501af01bd3490e93c.zip
Debug interface for the CPU frequency adjustment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6097 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 18b081df76..2035a45810 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -567,6 +567,7 @@ bool dbg_partitions(void)
567} 567}
568 568
569#ifdef HAVE_LCD_BITMAP 569#ifdef HAVE_LCD_BITMAP
570static bool boost = false;
570/* Test code!!! */ 571/* Test code!!! */
571bool dbg_ports(void) 572bool dbg_ports(void)
572{ 573{
@@ -635,7 +636,7 @@ bool dbg_ports(void)
635 unsigned int gpio_enable; 636 unsigned int gpio_enable;
636 unsigned int gpio1_enable; 637 unsigned int gpio1_enable;
637 int adc_buttons, adc_remote, adc_battery; 638 int adc_buttons, adc_remote, adc_battery;
638 char buf[32]; 639 char buf[128];
639 int button; 640 int button;
640 int line; 641 int line;
641 642
@@ -657,33 +658,33 @@ bool dbg_ports(void)
657 gpio_enable = GPIO_ENABLE; 658 gpio_enable = GPIO_ENABLE;
658 gpio1_enable = GPIO1_ENABLE; 659 gpio1_enable = GPIO1_ENABLE;
659 660
660 snprintf(buf, 32, "GPIO_READ: %08x", gpio_read); 661 snprintf(buf, sizeof(buf), "GPIO_READ: %08x", gpio_read);
661 lcd_puts(0, line++, buf); 662 lcd_puts(0, line++, buf);
662 snprintf(buf, 32, "GPIO_OUT: %08x", gpio_out); 663 snprintf(buf, sizeof(buf), "GPIO_OUT: %08x", gpio_out);
663 lcd_puts(0, line++, buf); 664 lcd_puts(0, line++, buf);
664 snprintf(buf, 32, "GPIO_FUNCTION: %08x", gpio_function); 665 snprintf(buf, sizeof(buf), "GPIO_FUNCTION: %08x", gpio_function);
665 lcd_puts(0, line++, buf); 666 lcd_puts(0, line++, buf);
666 snprintf(buf, 32, "GPIO_ENABLE: %08x", gpio_enable); 667 snprintf(buf, sizeof(buf), "GPIO_ENABLE: %08x", gpio_enable);
667 lcd_puts(0, line++, buf); 668 lcd_puts(0, line++, buf);
668 669
669 snprintf(buf, 32, "GPIO1_READ: %08x", gpio1_read); 670 snprintf(buf, sizeof(buf), "GPIO1_READ: %08x", gpio1_read);
670 lcd_puts(0, line++, buf); 671 lcd_puts(0, line++, buf);
671 snprintf(buf, 32, "GPIO1_OUT: %08x", gpio1_out); 672 snprintf(buf, sizeof(buf), "GPIO1_OUT: %08x", gpio1_out);
672 lcd_puts(0, line++, buf); 673 lcd_puts(0, line++, buf);
673 snprintf(buf, 32, "GPIO1_FUNCTION: %08x", gpio1_function); 674 snprintf(buf, sizeof(buf), "GPIO1_FUNCTION: %08x", gpio1_function);
674 lcd_puts(0, line++, buf); 675 lcd_puts(0, line++, buf);
675 snprintf(buf, 32, "GPIO1_ENABLE: %08x", gpio1_enable); 676 snprintf(buf, sizeof(buf), "GPIO1_ENABLE: %08x", gpio1_enable);
676 lcd_puts(0, line++, buf); 677 lcd_puts(0, line++, buf);
677 678
678 adc_buttons = adc_read(ADC_BUTTONS); 679 adc_buttons = adc_read(ADC_BUTTONS);
679 adc_remote = adc_read(ADC_REMOTE); 680 adc_remote = adc_read(ADC_REMOTE);
680 adc_battery = adc_read(ADC_BATTERY); 681 adc_battery = adc_read(ADC_BATTERY);
681 682
682 snprintf(buf, 32, "ADC_BUTTONS: %02x", adc_buttons); 683 snprintf(buf, sizeof(buf), "ADC_BUTTONS: %02x", adc_buttons);
683 lcd_puts(0, line++, buf); 684 lcd_puts(0, line++, buf);
684 snprintf(buf, 32, "ADC_REMOTE: %02x", adc_remote); 685 snprintf(buf, sizeof(buf), "ADC_REMOTE: %02x", adc_remote);
685 lcd_puts(0, line++, buf); 686 lcd_puts(0, line++, buf);
686 snprintf(buf, 32, "ADC_BATTERY: %02x", adc_battery); 687 snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery);
687 lcd_puts(0, line++, buf); 688 lcd_puts(0, line++, buf);
688 689
689 lcd_update(); 690 lcd_update();
@@ -691,6 +692,24 @@ bool dbg_ports(void)
691 692
692 switch(button) 693 switch(button)
693 { 694 {
695 case BUTTON_UP:
696 cpu_boost(true);
697 snprintf(buf, sizeof(buf), "freq: %d, IDECONFIG1: %08x, IDECONFIG2: %08x", FREQ, IDECONFIG1, IDECONFIG2);
698 splash(HZ, false, buf);
699 break;
700
701 case BUTTON_DOWN:
702 cpu_boost(false);
703 snprintf(buf, sizeof(buf), "freq: %d, IDECONFIG1: %08x, IDECONFIG2: %08x", FREQ, IDECONFIG1, IDECONFIG2);
704 splash(HZ, false, buf);
705 break;
706
707 case BUTTON_SELECT:
708 set_cpu_frequency(CPUFREQ_DEFAULT);
709 snprintf(buf, sizeof(buf), "freq: %d, IDECONFIG1: %08x, IDECONFIG2: %08x", FREQ, IDECONFIG1, IDECONFIG2);
710 splash(HZ, false, buf);
711 break;
712
694 case SETTINGS_CANCEL: 713 case SETTINGS_CANCEL:
695 return false; 714 return false;
696 } 715 }