为什么这代码,加了红色部分代码才可以正常的运行显示?
void Lcd_show_bmp(unsigned short int x, unsigned short int y,unsigned char *pic_name)
{
int i, j, k;
GUI_HMEM hMem;
char *_acBuffer2;
BYTE jj[3000];
unsigned int read_num;
unsigned char tmp_name[20];
sprintf((char*)tmp_name,"0:%s",pic_name);
_acBuffer2 = (char *)(0x680c0000);
f_mount(0, &bmpfs[0]);
bmpres = f_open( &bmpfsrc , (char *)tmp_name, FA_OPEN_EXISTING | FA_READ | FA_OPEN_ALWAYS);
/*-------------------------------------------------------------------------------------------------------*/
f_read(&bmpfsrc, _acBuffer2 ,bmpfsrc.fsize,&read_num);
for(i=0;i<100;i++)
printf(&quot;%c&quot;,*(_acBuffer2+i));
GUI_BMP_Draw(_acBuffer2,0,0);
GUI_BMP_DrawScaled(_acBuffer2,0,0,2,3);
GUI_BMP_DrawScaled(_acBuffer2,0,0,1,3);
f_close(&bmpfsrc);
}
int main(void)
{
USART1_Config();
//printf(&quot;\r\n this is a fatfs test demo \r\n&quot;);
LCD_Init();
SysTick_Init();
Sd_fs_init();
FSMC_SRAM_Init();
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
GUI_Init();
Lcd_show_bmp(0, 0,&quot;lxh.bmp&quot;);
GUI_DispString(&quot;www.armfly.com \navailable&quot;);
while(1)
{
GUI_Delay(100);
}
} |