summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 21:24:13 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 21:24:13 +0000
commit5a5c869e032a3fb0587562fcb29c78e7e0a4734c (patch)
treefc4d3966367d3b6d1871102462aab2c855278e01 /apps
parent92e9b150261a3d770aee7611192ee1cf0a2439a1 (diff)
downloadrockbox-5a5c869e032a3fb0587562fcb29c78e7e0a4734c.tar.gz
rockbox-5a5c869e032a3fb0587562fcb29c78e7e0a4734c.zip
Removed frequency info from Debug HW Info, and added a Save ROM Contents item to the debug menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3681 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 8895c71bca..188e7ec7bb 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -233,9 +233,6 @@ bool dbg_hw_info(void)
233 int pr_polarity; 233 int pr_polarity;
234 int bitmask = *(unsigned short*)0x20000fc; 234 int bitmask = *(unsigned short*)0x20000fc;
235 int rom_version = *(unsigned short*)0x20000fe; 235 int rom_version = *(unsigned short*)0x20000fe;
236 unsigned char sec, sec2;
237 unsigned long tick;
238 bool is_12mhz;
239 unsigned manu, id; /* flash IDs */ 236 unsigned manu, id; /* flash IDs */
240 bool got_id; /* flag if we managed to get the flash IDs */ 237 bool got_id; /* flag if we managed to get the flash IDs */
241 238
@@ -249,19 +246,6 @@ bool dbg_hw_info(void)
249 else 246 else
250 pr_polarity = 1; /* Positive */ 247 pr_polarity = 1; /* Positive */
251 248
252 sec = rtc_read(0x01);
253 do {
254 sec2 = rtc_read(0x01);
255 } while(sec == sec2);
256
257 tick = current_tick;
258
259 do {
260 sec = rtc_read(0x01);
261 } while(sec2 == sec);
262
263 is_12mhz = (current_tick - tick > HZ);
264
265 /* get flash ROM type */ 249 /* get flash ROM type */
266 got_id = dbg_flash_id(&manu, &id, 0x5555, 0x2AAA); /* try SST, Atmel, NexFlash */ 250 got_id = dbg_flash_id(&manu, &id, 0x5555, 0x2AAA); /* try SST, Atmel, NexFlash */
267 if (!got_id) 251 if (!got_id)
@@ -288,14 +272,11 @@ bool dbg_hw_info(void)
288 snprintf(buf, 32, "PR: %s", pr_polarity?"positive":"negative"); 272 snprintf(buf, 32, "PR: %s", pr_polarity?"positive":"negative");
289 lcd_puts(0, 5, buf); 273 lcd_puts(0, 5, buf);
290 274
291 snprintf(buf, 32, "Freq: %s", is_12mhz?"12MHz":"11.0592MHz");
292 lcd_puts(0, 6, buf);
293
294 if (got_id) 275 if (got_id)
295 snprintf(buf, 32, "Flash: M=%02x D=%02x", manu, id); 276 snprintf(buf, 32, "Flash: M=%02x D=%02x", manu, id);
296 else 277 else
297 snprintf(buf, 32, "Flash: M=?? D=??"); /* unknown, sorry */ 278 snprintf(buf, 32, "Flash: M=?? D=??"); /* unknown, sorry */
298 lcd_puts(0, 7, buf); 279 lcd_puts(0, 6, buf);
299 280
300 lcd_update(); 281 lcd_update();
301 282
@@ -1254,12 +1235,34 @@ static bool dbg_disk_info(void)
1254 return false; 1235 return false;
1255} 1236}
1256 1237
1238bool dbg_save_roms(void)
1239{
1240 int fd;
1241
1242 fd = creat("/internal_rom_0000-FFFF.bin", O_WRONLY);
1243 if(fd >= 0)
1244 {
1245 write(fd, (void *)0, 0x10000);
1246 close(fd);
1247 }
1248
1249 fd = creat("/internal_rom_2000000-203FFFF.bin", O_WRONLY);
1250 if(fd >= 0)
1251 {
1252 write(fd, (void *)0x2000000, 0x40000);
1253 close(fd);
1254 }
1255
1256 return false;
1257}
1258
1257bool debug_menu(void) 1259bool debug_menu(void)
1258{ 1260{
1259 int m; 1261 int m;
1260 bool result; 1262 bool result;
1261 1263
1262 struct menu_items items[] = { 1264 struct menu_items items[] = {
1265 { "Dump ROM contents", dbg_save_roms },
1263 { "View I/O ports", dbg_ports }, 1266 { "View I/O ports", dbg_ports },
1264#ifdef HAVE_LCD_BITMAP 1267#ifdef HAVE_LCD_BITMAP
1265#ifdef HAVE_RTC 1268#ifdef HAVE_RTC