Hi,
I have created a xbf file through font converter with extended type font.
I placed a xbf file into a SDcard.
code snippet for creating xbf file:
GUI_FONT XBFFont;
GUI_XBF_DATA XBF_Data;
int _cbGetData(U32 Off, U16 NumBytes,void * pVoid, void * pBuffer)
{
FS_FILE * handle;
DWORD NumBytesRead;
char pData[100];
//*pData1;
//buff=(char*)pBuffer;
// pBuffer = (U8 *)pBuffer;
//pBuffer=pData;
handle = (FS_FILE *)pVoid;
if (FS_FSeek(handle, Off, FS_SEEK_SET) == 0xFFFFFFFF) {
return 0;
}
NumBytesRead = FS_Read(handle, pData, NumBytes); //when this statement is executes the system goes to Hardfault
pBuffer=(void *)pData;
if( !NumBytesRead )
return 1;
if (NumBytesRead != NumBytes) {
return 1; // Error
}
return 0; // Ok
//return NumBytesRead;
}
main()
{
FS_FILE *hFile1,
hFile1 = FS_FOpen("mmc:0:\\\\Arial16.xbf", "rb");
GUI_XBF_CreateFont(&XBFFont, /* Pointer to GUI_FONT structure in RAM */
&XBF_Data, /* Pointer to GUI_XBF_DATA structure in RAM */
GUI_XBF_TYPE_PROP_EXT, /* Font type to be created */
// GUI_XBF_TYPE_PROP_AA4_EXT,
_cbGetData, /* Pointer to callback function */
&hFile1);
}
How to read a data from file to void *pBuffer in getdata callback function.
The system was crashing as soon it hits to execute the FS_read (Handle,pData,Numbytes);
Regards,
venkat
I have created a xbf file through font converter with extended type font.
I placed a xbf file into a SDcard.
code snippet for creating xbf file:
GUI_FONT XBFFont;
GUI_XBF_DATA XBF_Data;
int _cbGetData(U32 Off, U16 NumBytes,void * pVoid, void * pBuffer)
{
FS_FILE * handle;
DWORD NumBytesRead;
char pData[100];
//*pData1;
//buff=(char*)pBuffer;
// pBuffer = (U8 *)pBuffer;
//pBuffer=pData;
handle = (FS_FILE *)pVoid;
if (FS_FSeek(handle, Off, FS_SEEK_SET) == 0xFFFFFFFF) {
return 0;
}
NumBytesRead = FS_Read(handle, pData, NumBytes); //when this statement is executes the system goes to Hardfault
pBuffer=(void *)pData;
if( !NumBytesRead )
return 1;
if (NumBytesRead != NumBytes) {
return 1; // Error
}
return 0; // Ok
//return NumBytesRead;
}
main()
{
FS_FILE *hFile1,
hFile1 = FS_FOpen("mmc:0:\\\\Arial16.xbf", "rb");
GUI_XBF_CreateFont(&XBFFont, /* Pointer to GUI_FONT structure in RAM */
&XBF_Data, /* Pointer to GUI_XBF_DATA structure in RAM */
GUI_XBF_TYPE_PROP_EXT, /* Font type to be created */
// GUI_XBF_TYPE_PROP_AA4_EXT,
_cbGetData, /* Pointer to callback function */
&hFile1);
}
How to read a data from file to void *pBuffer in getdata callback function.
The system was crashing as soon it hits to execute the FS_read (Handle,pData,Numbytes);
Regards,
venkat