summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c3
-rw-r--r--firmware/drivers/ata.h1
2 files changed, 4 insertions, 0 deletions
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