1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| /**
* @brief Function fetches data from microSD card and stores in External Buffer.
* @param offset : Data offset in resource file.
* @param count : Number bytes that should be read.
* @param num : (Pointer) Number of bytes that are actually read from microSD.
* @return Pointer to External Data Buffer where read data is stored.
*/
uint8* TFT_Get_Data(uint32 offset, uint32 count, uint32 *num) {
uint32 pos = 0;
FS_FSeek(pFile, offset, FS_SEEK_SET);
pos = (uint32)offset%512;
if (count <= 512) {
*num = FS_Read(pFile, Ext_Data_Buffer, count);
}
else {
FS_Read(pFile, Ext_Data_Buffer, 512);
*num = 512-pos;
}
return Ext_Data_Buffer;
} |
Partager