From b070dd55be61b19a0cf88cd8d8a5b80387c50f31 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Wed, 4 Dec 2002 14:58:48 +0000 Subject: Added disk spinup clocking git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2927 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata.c | 3 +++ firmware/drivers/ata.h | 1 + 2 files changed, 4 insertions(+) (limited to 'firmware/drivers') 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 -- cgit v1.2.3