iPod Classic CE-ATA Support (Part 2 of 4: Remove on-stack sector buffers, and replace them with a single statically allocated sector buffer that's arbitrated amongst users)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29445 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sparmann 2011-02-27 22:44:54 +00:00
parent 751303c2ac
commit 1b5e31ed43
5 changed files with 141 additions and 28 deletions

View file

@ -27,6 +27,7 @@
#include "logf.h"
#include "storage.h"
#include "disk.h"
#include "fat.h"
/* Needed to get at the audio buffer */
#include "audio.h"
#include "usb_storage.h"
@ -358,8 +359,10 @@ static bool check_disk_present(IF_MD_NONVOID(int volume))
#ifdef USB_USE_RAMDISK
return true;
#else
unsigned char sector[SECTOR_SIZE];
return storage_read_sectors(IF_MD2(volume,)0,1,sector) == 0;
unsigned char* sector = fat_get_sector_buffer();
bool success = storage_read_sectors(IF_MD2(volume,)0,1,sector) == 0;
fat_release_sector_buffer();
return success;
#endif
}