summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata_mmc.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2006-11-08 01:55:26 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2006-11-08 01:55:26 +0000
commitf184152c0501a80e95ad871927d766fdee50281b (patch)
treeecfa4b6cdf24065b32467d6d7274a2659c3ec9b0 /firmware/drivers/ata_mmc.c
parent5dd07759248fec1407f6b3d4d1fb177554e45a13 (diff)
downloadrockbox-f184152c0501a80e95ad871927d766fdee50281b.tar.gz
rockbox-f184152c0501a80e95ad871927d766fdee50281b.zip
* 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
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r--firmware/drivers/ata_mmc.c31
1 files changed, 0 insertions, 31 deletions
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;
98#endif 98#endif
99static bool initialized = false; 99static bool initialized = false;
100static bool new_mmc_circuit; 100static bool new_mmc_circuit;
101static bool delayed_write = false;
102static unsigned char delayed_sector[SECTOR_SIZE];
103static int delayed_sector_num;
104 101
105static enum { 102static enum {
106 MMC_UNKNOWN, 103 MMC_UNKNOWN,
@@ -805,10 +802,6 @@ int ata_read_sectors(IF_MV2(int drive,)
805 802
806 deselect_card(); 803 deselect_card();
807 804
808 /* only flush if reading went ok */
809 if ( (rc == 0) && delayed_write )
810 ata_flush();
811
812 return rc; 805 return rc;
813} 806}
814 807
@@ -960,33 +953,9 @@ int ata_write_sectors(IF_MV2(int drive,)
960 953
961 deselect_card(); 954 deselect_card();
962 955
963 /* only flush if writing went ok */
964 if ( (rc == 0) && delayed_write )
965 ata_flush();
966
967 return rc; 956 return rc;
968} 957}
969 958
970/* While there is no spinup, the delayed write is still here to avoid
971 wearing the flash unnecessarily */
972extern void ata_delayed_write(unsigned long sector, const void* buf)
973{
974 memcpy(delayed_sector, buf, SECTOR_SIZE);
975 delayed_sector_num = sector;
976 delayed_write = true;
977}
978
979/* write the delayed sector to volume 0 */
980extern void ata_flush(void)
981{
982 if ( delayed_write )
983 {
984 DEBUGF("ata_flush()\n");
985 delayed_write = false;
986 ata_write_sectors(IF_MV2(0,) delayed_sector_num, 1, delayed_sector);
987 }
988}
989
990void ata_spindown(int seconds) 959void ata_spindown(int seconds)
991{ 960{
992 (void)seconds; 961 (void)seconds;