summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c9
-rw-r--r--firmware/drivers/ata.c3
-rw-r--r--firmware/drivers/ata.h1
3 files changed, 12 insertions, 1 deletions
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)
1107 bool done = false; 1107 bool done = false;
1108 int i; 1108 int i;
1109 int page = 0; 1109 int page = 0;
1110 const int max_page = 2; 1110 const int max_page = 3;
1111 unsigned short* identify_info = ata_get_identify(); 1111 unsigned short* identify_info = ata_get_identify();
1112 1112
1113 while(!done) 1113 while(!done)
@@ -1146,6 +1146,13 @@ static bool dbg_disk_info(void)
1146 (unsigned)identify_info[60]) / 2048 ); 1146 (unsigned)identify_info[60]) / 2048 );
1147 lcd_puts(0, y++, "Size"); 1147 lcd_puts(0, y++, "Size");
1148 lcd_puts(0, y++, buf); 1148 lcd_puts(0, y++, buf);
1149 break;
1150
1151 case 3:
1152 snprintf(buf, sizeof buf, "%d ms", ata_spinup_time * (1000/HZ));
1153 lcd_puts(0, y++, "Spinup time");
1154 lcd_puts(0, y++, buf);
1155 break;
1149 } 1156 }
1150 lcd_update(); 1157 lcd_update();
1151 1158
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 */
80static volatile unsigned char* ata_control; 80static volatile unsigned char* ata_control;
81 81
82bool old_recorder = false; 82bool old_recorder = false;
83int ata_spinup_time = 0;
83static bool sleeping = false; 84static bool sleeping = false;
84static int sleep_timeout = 5*HZ; 85static int sleep_timeout = 5*HZ;
85static bool poweroff = false; 86static bool poweroff = false;
@@ -186,6 +187,7 @@ int ata_read_sectors(unsigned long start,
186 } 187 }
187 sleeping = false; 188 sleeping = false;
188 poweroff = false; 189 poweroff = false;
190 ata_spinup_time = current_tick - last_disk_activity;
189 } 191 }
190 192
191 ATA_SELECT = ata_device; 193 ATA_SELECT = ata_device;
@@ -307,6 +309,7 @@ int ata_write_sectors(unsigned long start,
307 } 309 }
308 sleeping = false; 310 sleeping = false;
309 poweroff = false; 311 poweroff = false;
312 ata_spinup_time = current_tick - last_disk_activity;
310 } 313 }
311 314
312 ATA_SELECT = ata_device; 315 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);
48extern unsigned short* ata_get_identify(void); 48extern unsigned short* ata_get_identify(void);
49 49
50extern long last_disk_activity; 50extern long last_disk_activity;
51extern int ata_spinup_time; /* ticks */
51 52
52#endif 53#endif