summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2011-02-27 22:44:54 +0000
committerMichael Sparmann <theseven@rockbox.org>2011-02-27 22:44:54 +0000
commit1b5e31ed43d2c09ada6a1313b2a1de0b262e74c6 (patch)
treeb31aa2a0d8cd63e0306b39f0a9e599339d586659 /firmware/usbstack
parent751303c2acf22f7fa431690efcddcc8cb0d3a84e (diff)
downloadrockbox-1b5e31ed43d2c09ada6a1313b2a1de0b262e74c6.tar.gz
rockbox-1b5e31ed43d2c09ada6a1313b2a1de0b262e74c6.tar.bz2
rockbox-1b5e31ed43d2c09ada6a1313b2a1de0b262e74c6.zip
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
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_storage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index d8d6817ad2..6d407cccc5 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -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
}