Storing file and the fopen() function

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

Storing file and the fopen() function

544 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by netsupra on Mon Oct 15 15:18:16 MST 2012
Hi everybody,

I'm trying to open a file using fopen but I don't know how to store the file on the microcontroller.

I'm using a LPC11C24 and the file I want to access is a bmp file.

Thank you,
Netsupra
0 项奖励
回复
2 回复数

498 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by netsupra on Tue Oct 16 03:03:41 MST 2012
Thank you for your reply.
0 项奖励
回复

498 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by daniel.widyanto on Mon Oct 15 21:20:49 MST 2012
Well, unfortunately, you are running an embedded system, where abstraction concepts of file and memory are not defined.

Usually, people convert the BMP file into C array (See http://www.deadnode.org/sw/bin2h/), then accessing the C-array directly, like

for (i = 0; i < mybmp_sz; i++) {
  *framebuffer = mybmp;
}
0 项奖励
回复