From f184152c0501a80e95ad871927d766fdee50281b Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 8 Nov 2006 01:55:26 +0000 Subject: * changes to ata.c - idle callbacks are called after 2 sec of real idle, and shutdown and usb (it makes sense here). ata_sleep doesnt get broken by callbacks. * allow ata_sleep() at the end of buffering again * config block uses ata_idle instead of delayed sector when saving * remove delayed sector code from ata_mmc.c (idle callbacks are not yet implemented for ata_mmc.c tho) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11461 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata_mmc.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'firmware/drivers/ata_mmc.c') diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 6303ca2851..64a7ba4bfd 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c @@ -98,9 +98,6 @@ static bool mmc_monitor_enabled = true; #endif static bool initialized = false; static bool new_mmc_circuit; -static bool delayed_write = false; -static unsigned char delayed_sector[SECTOR_SIZE]; -static int delayed_sector_num; static enum { MMC_UNKNOWN, @@ -805,10 +802,6 @@ int ata_read_sectors(IF_MV2(int drive,) deselect_card(); - /* only flush if reading went ok */ - if ( (rc == 0) && delayed_write ) - ata_flush(); - return rc; } @@ -960,33 +953,9 @@ int ata_write_sectors(IF_MV2(int drive,) deselect_card(); - /* only flush if writing went ok */ - if ( (rc == 0) && delayed_write ) - ata_flush(); - return rc; } -/* While there is no spinup, the delayed write is still here to avoid - wearing the flash unnecessarily */ -extern void ata_delayed_write(unsigned long sector, const void* buf) -{ - memcpy(delayed_sector, buf, SECTOR_SIZE); - delayed_sector_num = sector; - delayed_write = true; -} - -/* write the delayed sector to volume 0 */ -extern void ata_flush(void) -{ - if ( delayed_write ) - { - DEBUGF("ata_flush()\n"); - delayed_write = false; - ata_write_sectors(IF_MV2(0,) delayed_sector_num, 1, delayed_sector); - } -} - void ata_spindown(int seconds) { (void)seconds; -- cgit v1.2.3