summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-10-27 05:31:28 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-10-27 05:31:28 +0000
commit1d4a9c63666541b9e42b5d197d6afec21eb26b4e (patch)
tree6b33e5a3818e0712147cba869ead61421fedc90f /apps
parentd4dfe957f23bce14116ea9f5bdbaa77435f69908 (diff)
downloadrockbox-1d4a9c63666541b9e42b5d197d6afec21eb26b4e.tar.gz
rockbox-1d4a9c63666541b9e42b5d197d6afec21eb26b4e.zip
Stop reading buttons if one is not down. Don't read remote keys if not plugged. Good for another few points of boost and 4fps full-screen unboosted. The button scan enabling seems stable and I've been using it without any difficulties but if the interrupts hiccup it could leave them unresponsive. Clearing the GPI0 interrupts before enabling them seems to prevent any difficulties. If there's problems there I'll just leave the remote reading bypass only and 50% of the benefits will still be realized.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11357 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 42c5776128..712a66cfa0 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -76,6 +76,10 @@
76#include "pcm_playback.h" 76#include "pcm_playback.h"
77#endif 77#endif
78 78
79#ifdef IAUDIO_X5
80#include "lcd-remote-target.h"
81#endif
82
79/*---------------------------------------------------*/ 83/*---------------------------------------------------*/
80/* SPECIAL DEBUG STUFF */ 84/* SPECIAL DEBUG STUFF */
81/*---------------------------------------------------*/ 85/*---------------------------------------------------*/
@@ -92,7 +96,7 @@ char thread_status_char(int status)
92 case STATE_SLEEPING : return 'S'; 96 case STATE_SLEEPING : return 'S';
93 case STATE_BLOCKED_W_TMO: return 'T'; 97 case STATE_BLOCKED_W_TMO: return 'T';
94 } 98 }
95 99
96 return '?'; 100 return '?';
97} 101}
98#ifndef SIMULATOR 102#ifndef SIMULATOR
@@ -130,12 +134,12 @@ bool dbg_os(void)
130 thread = &cores[core].threads[i]; 134 thread = &cores[core].threads[i];
131 if (thread->name == NULL) 135 if (thread->name == NULL)
132 continue; 136 continue;
133 137
134 usage = thread_stack_usage(thread); 138 usage = thread_stack_usage(thread);
135 status = thread_get_status(thread); 139 status = thread_get_status(thread);
136 140
137 snprintf(buf, 32, "(%d) %c%c %d %s: %d%%", core, 141 snprintf(buf, 32, "(%d) %c%c %d %s: %d%%", core,
138 (status == STATE_RUNNING) ? '*' : ' ', 142 (status == STATE_RUNNING) ? '*' : ' ',
139 thread_status_char(status), 143 thread_status_char(status),
140 cores[CURRENT_CORE].threads[i].priority, 144 cores[CURRENT_CORE].threads[i].priority,
141 cores[core].threads[i].name, usage); 145 cores[core].threads[i].name, usage);
@@ -149,19 +153,19 @@ bool dbg_os(void)
149 thread = &cores[CURRENT_CORE].threads[i]; 153 thread = &cores[CURRENT_CORE].threads[i];
150 if (thread->name == NULL) 154 if (thread->name == NULL)
151 continue; 155 continue;
152 156
153 usage = thread_stack_usage(thread); 157 usage = thread_stack_usage(thread);
154 status = thread_get_status(thread); 158 status = thread_get_status(thread);
155# ifdef HAVE_PRIORITY_SCHEDULING 159# ifdef HAVE_PRIORITY_SCHEDULING
156 snprintf(buf, 32, "%c%c %d %s: %d%%", 160 snprintf(buf, 32, "%c%c %d %s: %d%%",
157 (status == STATE_RUNNING) ? '*' : ' ', 161 (status == STATE_RUNNING) ? '*' : ' ',
158 thread_status_char(status), 162 thread_status_char(status),
159 cores[CURRENT_CORE].threads[i].priority, 163 cores[CURRENT_CORE].threads[i].priority,
160 cores[CURRENT_CORE].threads[i].name, usage); 164 cores[CURRENT_CORE].threads[i].name, usage);
161# else 165# else
162 snprintf(buf, 32, "%c%c %s: %d%%", 166 snprintf(buf, 32, "%c%c %s: %d%%",
163 (status == STATE_RUNNING) ? '*' : ' ', 167 (status == STATE_RUNNING) ? '*' : ' ',
164 (status == STATE_BLOCKED) ? 'B' : ' ', 168 (status == STATE_BLOCKED) ? 'B' : ' ',
165 cores[CURRENT_CORE].threads[i].name, usage); 169 cores[CURRENT_CORE].threads[i].name, usage);
166# endif 170# endif
167 lcd_puts(0, 1+i, buf); 171 lcd_puts(0, 1+i, buf);
@@ -1066,9 +1070,17 @@ bool dbg_ports(void)
1066 adc_remotedetect = adc_read(ADC_REMOTEDETECT); 1070 adc_remotedetect = adc_read(ADC_REMOTEDETECT);
1067#endif 1071#endif
1068 1072
1073#ifdef IAUDIO_X5
1074 snprintf(buf, sizeof(buf), "ADC_BUTTONS (%c): %02x",
1075 adc_get_button_scan_enabled() ? '+' : '-', adc_buttons);
1076 lcd_puts(0, line++, buf);
1077 snprintf(buf, sizeof(buf), "ADC_REMOTE (%c): %02x",
1078 remote_detect() ? '+' : '-', adc_remote);
1079#else
1069 snprintf(buf, sizeof(buf), "ADC_BUTTONS: %02x", adc_buttons); 1080 snprintf(buf, sizeof(buf), "ADC_BUTTONS: %02x", adc_buttons);
1070 lcd_puts(0, line++, buf); 1081 lcd_puts(0, line++, buf);
1071 snprintf(buf, sizeof(buf), "ADC_REMOTE: %02x", adc_remote); 1082 snprintf(buf, sizeof(buf), "ADC_REMOTE: %02x", adc_remote);
1083#endif
1072 lcd_puts(0, line++, buf); 1084 lcd_puts(0, line++, buf);
1073 snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery); 1085 snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery);
1074 lcd_puts(0, line++, buf); 1086 lcd_puts(0, line++, buf);
@@ -1438,7 +1450,7 @@ bool view_battery(void)
1438 ext_pwr ? "present" : "absent"); 1450 ext_pwr ? "present" : "absent");
1439 lcd_puts(0, 4, buf); 1451 lcd_puts(0, 4, buf);
1440 snprintf(buf, 30, "Battery: %s", 1452 snprintf(buf, 30, "Battery: %s",
1441 charging ? "charging" : (usb_pwr||ext_pwr) ? "charged" : "discharging"); 1453 charging ? "charging" : (usb_pwr||ext_pwr) ? "charged" : "discharging");
1442 lcd_puts(0, 5, buf); 1454 lcd_puts(0, 5, buf);
1443 snprintf(buf, 30, "Dock mode: %s", 1455 snprintf(buf, 30, "Dock mode: %s",
1444 dock ? "enabled" : "disabled"); 1456 dock ? "enabled" : "disabled");