diff options
| author | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-08-02 12:53:57 +0000 |
|---|---|---|
| committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-08-02 12:53:57 +0000 |
| commit | f80505c9d0275ce56b9d03b01aa96a5ad2ac0b59 (patch) | |
| tree | 8447074db140cce259e8effe7f65b4cfa7a26d34 /apps/debug_menu.c | |
| parent | 9513236c9454ec363392c9160f533780f924b8e9 (diff) | |
| download | rockbox-f80505c9d0275ce56b9d03b01aa96a5ad2ac0b59.zip rockbox-f80505c9d0275ce56b9d03b01aa96a5ad2ac0b59.tar.gz rockbox-f80505c9d0275ce56b9d03b01aa96a5ad2ac0b59.tar.bz2 rockbox-f80505c9d0275ce56b9d03b01aa96a5ad2ac0b59.tar.xz | |
Diagnostic code added, to find init problems (charging, etc.) when flashed: the whole I/O space is saved on startup, can be dumped to a file via debug menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3912 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
| -rw-r--r-- | apps/debug_menu.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 6df8f2f..91746d2 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -193,6 +193,7 @@ bool dbg_mpeg_thread(void) /* Tool function to calculate a CRC16 across some buffer */ unsigned short crc_16(unsigned char* buf, unsigned len) { + /* CCITT standard polynomial 0x1021 */ static const unsigned short crc16_lookup[16] = { /* lookup table for 4 bits at a time is affordable */ 0x0000, 0x1021, 0x2042, 0x3063, @@ -1324,6 +1325,30 @@ bool dbg_save_roms(void) return false; } + +/* test code, to be removed later */ +extern union /* defined in main.c */ +{ + unsigned char port8 [512]; + unsigned short port16[256]; + unsigned port32[128]; +} startup_io; + +bool dbg_save_io(void) /* dump the initial I/O space to disk */ +{ + int fd; + + fd = creat("/startup_io.bin", O_WRONLY); + if(fd >= 0) + { + write(fd, (void *)&startup_io, sizeof(startup_io)); + close(fd); + } + + return false; +} +/* end of test code */ + bool debug_menu(void) { int m; @@ -1331,6 +1356,7 @@ bool debug_menu(void) struct menu_items items[] = { { "Dump ROM contents", dbg_save_roms }, + { "Dump startup I/O", dbg_save_io }, { "View I/O ports", dbg_ports }, #ifdef HAVE_LCD_BITMAP #ifdef HAVE_RTC |