minor changes
This commit is contained in:
parent
eea4a455f0
commit
d7e9fc5dbe
32
src/mp3.c
32
src/mp3.c
@ -77,26 +77,7 @@ static int mp3_size(char* fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void _f_read(char* fname, unsigned char *readBuffer, int size){
|
static void _f_read(char* fname, unsigned char *readBuffer, int size){
|
||||||
/*
|
//TODO: function not working... probably worth switching to http://www.underbit.com/products/mad/ anyway...
|
||||||
FatRecord rec_tmpf;
|
|
||||||
u8 resp=0;
|
|
||||||
resp = fatOpenFileByName(fname, 0); //err if not found ^^
|
|
||||||
|
|
||||||
int fsize = file.sec_available*512; //fsize in bytes
|
|
||||||
mp3File_fsize = fsize;
|
|
||||||
|
|
||||||
//injecting in buffer... slow but working :/
|
|
||||||
if(file.sec_available*512>=size){
|
|
||||||
resp = fatReadPartialFile(readBuffer, size/512, mp3File_fptr);
|
|
||||||
//resp = fatReadFile(readBuffer+mp3File_fptr, size/512);//file.sec_available);
|
|
||||||
mp3File_fptr+=size;
|
|
||||||
|
|
||||||
}
|
|
||||||
//dma_write_s(buffer, 0xb0000000, fsize);
|
|
||||||
*/
|
|
||||||
|
|
||||||
mp3_size(fname);
|
|
||||||
|
|
||||||
FRESULT result;
|
FRESULT result;
|
||||||
FIL file;
|
FIL file;
|
||||||
UINT bytesread;
|
UINT bytesread;
|
||||||
@ -106,11 +87,9 @@ static void _f_read(char* fname, unsigned char *readBuffer, int size){
|
|||||||
{
|
{
|
||||||
int fsize = f_size(&file);
|
int fsize = f_size(&file);
|
||||||
|
|
||||||
if ( fsize > size)
|
mp3File_fsize = fsize;
|
||||||
{
|
|
||||||
//todo: set the read pointer
|
f_lseek(&file, mp3File_fptr);
|
||||||
//readBuffer+mp3File_fptr
|
|
||||||
}
|
|
||||||
|
|
||||||
result =
|
result =
|
||||||
f_read (
|
f_read (
|
||||||
@ -122,8 +101,7 @@ static void _f_read(char* fname, unsigned char *readBuffer, int size){
|
|||||||
|
|
||||||
f_close(&file);
|
f_close(&file);
|
||||||
|
|
||||||
mp3File_fptr+=size;
|
mp3File_fptr+=bytesread;
|
||||||
//dma_write_s(buffer, 0xb0000000, fsize);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ int getSRAM( uint8_t *buffer, int size){
|
|||||||
|
|
||||||
PI_Init();
|
PI_Init();
|
||||||
|
|
||||||
sleep(15); //TODO: really... 1 second, changed to 15ms... better check it still works!
|
sleep(250); //TODO: really... 1 second, changed to 250ms... better check it still works!
|
||||||
|
|
||||||
while (dma_busy()) ;
|
while (dma_busy()) ;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user