summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2008-02-10 05:39:20 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2008-02-10 05:39:20 +0000
commit054447f9e6037e4feb1a4c4313bd0afd4eb382a6 (patch)
tree57d78a645d2700d78a66f1807cc26dca9b6c45c9 /apps
parent2b3136e1f350721fa65cc304cad7a00504390850 (diff)
downloadrockbox-054447f9e6037e4feb1a4c4313bd0afd4eb382a6.tar.gz
rockbox-054447f9e6037e4feb1a4c4313bd0afd4eb382a6.zip
Commit FS#8379 by Andree Buschmann. Disables much of the remaining unneeded hardware on PP50xx targets (Ipods, Sansa, H10s, etc) resulting in a large savings in power and consequent increase in battery life. Results vary from target to target and from codec to codec, but we now approach the OF runtime on several PP devices. For now, leave base CPU clock at 30MHz, although further savings is possible with some codecs if clock is reduced. Additionally, fix battery capacity on c200 and use my measurements to improve runtime estimation for Sandisk targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16259 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c125
-rw-r--r--apps/main.c4
2 files changed, 123 insertions, 6 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index f5dbbf17a5..2e075479bf 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -87,6 +87,10 @@
87#include "ds2411.h" 87#include "ds2411.h"
88#endif 88#endif
89#include "hwcompat.h" 89#include "hwcompat.h"
90#include "button.h"
91#if CONFIG_RTC == RTC_PCF50605
92#include "pcf50605.h"
93#endif
90 94
91#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 95#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440
92#include "debug-target.h" 96#include "debug-target.h"
@@ -1167,14 +1171,20 @@ bool dbg_ports(void)
1167 lcd_puts(0, line++, buf); 1171 lcd_puts(0, line++, buf);
1168 line++; 1172 line++;
1169 1173
1170 snprintf(buf, sizeof(buf), "GPO32: %08lx", GPO32_VAL); 1174 snprintf(buf, sizeof(buf), "GPO32_VAL: %08lx", GPO32_VAL);
1175 lcd_puts(0, line++, buf);
1176 snprintf(buf, sizeof(buf), "GPO32_EN: %08lx", GPO32_ENABLE);
1171 lcd_puts(0, line++, buf); 1177 lcd_puts(0, line++, buf);
1172 snprintf(buf, sizeof(buf), "DEV_EN: %08lx", DEV_EN); 1178 snprintf(buf, sizeof(buf), "DEV_EN: %08lx", DEV_EN);
1173 lcd_puts(0, line++, buf); 1179 lcd_puts(0, line++, buf);
1174 snprintf(buf, sizeof(buf), "DEV_EN2: %08lx", DEV_EN2); 1180 snprintf(buf, sizeof(buf), "DEV_EN2: %08lx", DEV_EN2);
1175 lcd_puts(0, line++, buf); 1181 lcd_puts(0, line++, buf);
1176 snprintf(buf, sizeof(buf), "DEV_EN3: %08lx", inl(0x60006044)); 1182 snprintf(buf, sizeof(buf), "DEV_EN3: %08lx", inl(0x60006044));
1177 lcd_puts(0, line++, buf); /* to be verified */ 1183 lcd_puts(0, line++, buf); /* to be verified */
1184 snprintf(buf, sizeof(buf), "DEV_INIT1: %08lx", DEV_INIT1);
1185 lcd_puts(0, line++, buf);
1186 snprintf(buf, sizeof(buf), "DEV_INIT2: %08lx", DEV_INIT2);
1187 lcd_puts(0, line++, buf);
1178 1188
1179#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) 1189#if defined(IRIVER_H10) || defined(IRIVER_H10_5GB)
1180 line++; 1190 line++;
@@ -1353,6 +1363,60 @@ bool dbg_ports(void)
1353#endif /* !HAVE_LCD_BITMAP */ 1363#endif /* !HAVE_LCD_BITMAP */
1354#endif /* !SIMULATOR */ 1364#endif /* !SIMULATOR */
1355 1365
1366#if CONFIG_RTC == RTC_PCF50605
1367static bool dbg_pcf(void)
1368{
1369 char buf[128];
1370 int line;
1371
1372#ifdef HAVE_LCD_BITMAP
1373 lcd_setmargins(0, 0);
1374 lcd_setfont(FONT_SYSFIXED);
1375#endif
1376 lcd_clear_display();
1377
1378 while(1)
1379 {
1380 line = 0;
1381
1382 snprintf(buf, sizeof(buf), "DCDC1: %02x", pcf50605_read(0x1b));
1383 lcd_puts(0, line++, buf);
1384 snprintf(buf, sizeof(buf), "DCDC2: %02x", pcf50605_read(0x1c));
1385 lcd_puts(0, line++, buf);
1386 snprintf(buf, sizeof(buf), "DCDC3: %02x", pcf50605_read(0x1d));
1387 lcd_puts(0, line++, buf);
1388 snprintf(buf, sizeof(buf), "DCDC4: %02x", pcf50605_read(0x1e));
1389 lcd_puts(0, line++, buf);
1390 snprintf(buf, sizeof(buf), "DCDEC1: %02x", pcf50605_read(0x1f));
1391 lcd_puts(0, line++, buf);
1392 snprintf(buf, sizeof(buf), "DCDEC2: %02x", pcf50605_read(0x20));
1393 lcd_puts(0, line++, buf);
1394 snprintf(buf, sizeof(buf), "DCUDC1: %02x", pcf50605_read(0x21));
1395 lcd_puts(0, line++, buf);
1396 snprintf(buf, sizeof(buf), "DCUDC2: %02x", pcf50605_read(0x22));
1397 lcd_puts(0, line++, buf);
1398 snprintf(buf, sizeof(buf), "IOREGC: %02x", pcf50605_read(0x23));
1399 lcd_puts(0, line++, buf);
1400 snprintf(buf, sizeof(buf), "D1REGC: %02x", pcf50605_read(0x24));
1401 lcd_puts(0, line++, buf);
1402 snprintf(buf, sizeof(buf), "D2REGC: %02x", pcf50605_read(0x25));
1403 lcd_puts(0, line++, buf);
1404 snprintf(buf, sizeof(buf), "D3REGC: %02x", pcf50605_read(0x26));
1405 lcd_puts(0, line++, buf);
1406 snprintf(buf, sizeof(buf), "LPREG1: %02x", pcf50605_read(0x27));
1407 lcd_puts(0, line++, buf);
1408
1409 lcd_update();
1410 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
1411 {
1412 return false;
1413 }
1414 }
1415
1416 return false;
1417}
1418#endif
1419
1356#ifdef HAVE_ADJUSTABLE_CPU_FREQ 1420#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1357static bool dbg_cpufreq(void) 1421static bool dbg_cpufreq(void)
1358{ 1422{
@@ -2251,6 +2315,53 @@ static bool cpu_boost_log(void)
2251} 2315}
2252#endif 2316#endif
2253 2317
2318#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR))
2319extern bool wheel_is_touched;
2320extern int old_wheel_value;
2321extern int new_wheel_value;
2322extern int wheel_delta;
2323extern unsigned int accumulated_wheel_delta;
2324extern unsigned int wheel_velocity;
2325
2326static bool dbg_scrollwheel(void)
2327{
2328 char buf[64];
2329 unsigned int speed;
2330
2331 lcd_setmargins(0, 0);
2332 lcd_setfont(FONT_SYSFIXED);
2333
2334 while (1)
2335 {
2336 if (action_userabort(HZ/10))
2337 return false;
2338
2339 lcd_clear_display();
2340
2341 /* show internal variables of scrollwheel driver */
2342 snprintf(buf, sizeof(buf), "wheel touched: %s", (wheel_is_touched) ? "true" : "false");
2343 lcd_puts(0, 0, buf);
2344 snprintf(buf, sizeof(buf), "new position: %2d", new_wheel_value);
2345 lcd_puts(0, 1, buf);
2346 snprintf(buf, sizeof(buf), "old position: %2d", old_wheel_value);
2347 lcd_puts(0, 2, buf);
2348 snprintf(buf, sizeof(buf), "wheel delta: %2d", wheel_delta);
2349 lcd_puts(0, 3, buf);
2350 snprintf(buf, sizeof(buf), "accumulated delta: %2d", accumulated_wheel_delta);
2351 lcd_puts(0, 4, buf);
2352 snprintf(buf, sizeof(buf), "velo [deg/s]: %4d", (int)wheel_velocity);
2353 lcd_puts(0, 5, buf);
2354
2355 /* show effective accelerated scrollspeed */
2356 speed = button_apply_acceleration( (1<<31)|(1<<24)|wheel_velocity);
2357 snprintf(buf, sizeof(buf), "accel. speed: %4d", speed);
2358 lcd_puts(0, 6, buf);
2359
2360 lcd_update();
2361 }
2362 return false;
2363}
2364#endif
2254 2365
2255 2366
2256/****** The menu *********/ 2367/****** The menu *********/
@@ -2269,6 +2380,9 @@ static const struct the_menu_item menuitems[] = {
2269#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) || CONFIG_CPU == S3C2440 2380#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) || CONFIG_CPU == S3C2440
2270 { "View I/O ports", dbg_ports }, 2381 { "View I/O ports", dbg_ports },
2271#endif 2382#endif
2383#if CONFIG_RTC == RTC_PCF50605
2384 { "View PCF registers", dbg_pcf },
2385#endif
2272#if defined(HAVE_TSC2100) && !defined(SIMULATOR) 2386#if defined(HAVE_TSC2100) && !defined(SIMULATOR)
2273 { "TSC2100 debug", tsc2100_debug }, 2387 { "TSC2100 debug", tsc2100_debug },
2274#endif 2388#endif
@@ -2328,6 +2442,9 @@ static const struct the_menu_item menuitems[] = {
2328#ifdef CPU_BOOST_LOGGING 2442#ifdef CPU_BOOST_LOGGING
2329 {"cpu_boost log",cpu_boost_log}, 2443 {"cpu_boost log",cpu_boost_log},
2330#endif 2444#endif
2445#if (defined(HAVE_SCROLLWHEEL) && (CONFIG_KEYPAD==IPOD_4G_PAD) && !defined(SIMULATOR))
2446 {"Debug scrollwheel", dbg_scrollwheel},
2447#endif
2331 }; 2448 };
2332static int menu_action_callback(int btn, struct gui_synclist *lists) 2449static int menu_action_callback(int btn, struct gui_synclist *lists)
2333{ 2450{
diff --git a/apps/main.c b/apps/main.c
index 0ce8bcc7ac..92e7149fe8 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -351,6 +351,8 @@ static void init(void)
351 351
352 settings_reset(); 352 settings_reset();
353 353
354 i2c_init();
355
354 power_init(); 356 power_init();
355 357
356 set_irq_level(0); 358 set_irq_level(0);
@@ -374,8 +376,6 @@ static void init(void)
374#endif 376#endif
375#endif 377#endif
376 378
377 i2c_init();
378
379#if CONFIG_RTC 379#if CONFIG_RTC
380 rtc_init(); 380 rtc_init();
381#endif 381#endif