diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 571ab09ce5..e55aa12111 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1107,7 +1107,7 @@ static bool dbg_disk_info(void) bool done = false; int i; int page = 0; - const int max_page = 2; + const int max_page = 3; unsigned short* identify_info = ata_get_identify(); while(!done) @@ -1146,6 +1146,13 @@ static bool dbg_disk_info(void) (unsigned)identify_info[60]) / 2048 ); lcd_puts(0, y++, "Size"); lcd_puts(0, y++, buf); + break; + + case 3: + snprintf(buf, sizeof buf, "%d ms", ata_spinup_time * (1000/HZ)); + lcd_puts(0, y++, "Spinup time"); + lcd_puts(0, y++, buf); + break; } lcd_update(); diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 0b7a37e5ec..8f70714e4c 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -80,6 +80,7 @@ int ata_io_address; /* 0x300 or 0x200, only valid on recorder */ static volatile unsigned char* ata_control; bool old_recorder = false; +int ata_spinup_time = 0; static bool sleeping = false; static int sleep_timeout = 5*HZ; static bool poweroff = false; @@ -186,6 +187,7 @@ int ata_read_sectors(unsigned long start, } sleeping = false; poweroff = false; + ata_spinup_time = current_tick - last_disk_activity; } ATA_SELECT = ata_device; @@ -307,6 +309,7 @@ int ata_write_sectors(unsigned long start, } sleeping = false; poweroff = false; + ata_spinup_time = current_tick - last_disk_activity; } ATA_SELECT = ata_device; diff --git a/firmware/drivers/ata.h b/firmware/drivers/ata.h index a9a79870c4..7a1fb4a952 100644 --- a/firmware/drivers/ata.h +++ b/firmware/drivers/ata.h @@ -48,5 +48,6 @@ extern void ata_spin(void); extern unsigned short* ata_get_identify(void); extern long last_disk_activity; +extern int ata_spinup_time; /* ticks */ #endif