TWR-K70 + MQX + eGUI with external bitmaps

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

TWR-K70 + MQX + eGUI with external bitmaps

跳至解决方案
1,885 次查看
friederschrempf
Contributor IV

I'm trying to load bitmaps from an external location (usb device) with eGui (D4D) v3 beta on TWR-K70.

When I enable the external file support with

#define D4D_EXTSRC_FILE_ENABLE  D4D_TRUE

I get errors when I try to compile the project which tell me that d4d_extsrcFile (which is defined in d4d_extsrc.h) is undeclared in d4d_bmp.c and d4d_font.c.

There is a

extern const D4DFILE_FUNCTIONS d4d_extsrcFile;

in d4d_extsrc.h.

Does someone have an idea what might be wrong?

Thanks!

1 解答
1,447 次查看
Gargy
NXP Employee
NXP Employee

Hello,

if you switch on external bitmap support, you also have to define the eGUI API to file system, like this example:

D4D_DECLARE_FILE_FUNCTIONS(My_FileOpen, My_FileClose, My_FileRead, My_FileWrite, My_FileFseek, My_FileFtell) 

And the functions My_FileOpen... must exists in your project.

Check the examples what I put on : https://community.freescale.com/message/323071#323071

Petr

在原帖中查看解决方案

3 回复数
1,448 次查看
Gargy
NXP Employee
NXP Employee

Hello,

if you switch on external bitmap support, you also have to define the eGUI API to file system, like this example:

D4D_DECLARE_FILE_FUNCTIONS(My_FileOpen, My_FileClose, My_FileRead, My_FileWrite, My_FileFseek, My_FileFtell) 

And the functions My_FileOpen... must exists in your project.

Check the examples what I put on : https://community.freescale.com/message/323071#323071

Petr

1,447 次查看
friederschrempf
Contributor IV

Thank you Petr!

I added the file functions and it know compiles without errors.

Still I can't see the bitmap on my screen. I added a bmp file with 8bit color to my USB stick root directory and made sure that the LCD screen is loaded after the usb initialization. Reading from the stick in general works fine.

I declared the bitmap with

D4D_DECLARE_BMPFILE(bmp_as, "AS.BMP")

and put it in a picture object with

D4D_DECLARE_STD_PICTURE(ds_logo_as, 130, 100, &bmp_as)

and finally added it to the screen

D4D_DECLARE_SCREEN_OBJECT(ds_logo_as) 

What is missing?

Thanks!

0 项奖励
回复
1,447 次查看
friederschrempf
Contributor IV

I recompiled the project once more and know it works!

Don't know what was wrong.

Thank you again Petr!

0 项奖励
回复