پاسخ : فایل اکسپلورر mmc به وسیله arm
با سلام،
آقایون بازم معذرت میخوام، این تغییرات زیر رو هم برای نمایش سریعتر تصویر پیشنهاد میدم....
( اینجا کدها رو یه کمی درهم نشون میده، کپی کنید توی ادیتور کدتون، درست نشونشون میده! )
موفق باشید
با سلام،
آقایون بازم معذرت میخوام، این تغییرات زیر رو هم برای نمایش سریعتر تصویر پیشنهاد میدم....
کد:
//GLOBAL VARIABLES..... int TS_margin_xl = 0; int TS_margin_xr = TS_SIZE_X - 1; int TS_margin_yu = 0; int TS_margin_yl = TS_SIZE_Y - 1; unsigned int newX = 0; unsigned int newY = 0; // // // // //----------------------------------------------------------------------- // Set LCD working area for draw picture, fill etc. //----------------------------------------------------------------------- void tftlcd_SetArea(int sx,int ex,int sy,int ey) { if (sx < TS_margin_xl) sx = TS_margin_xl; if (ex > TS_margin_xr) ex = TS_margin_xr; if (sy < TS_margin_yu) sy = TS_margin_yu; if (ey > TS_margin_yl) ey = TS_margin_yl; newX = ex - sx + 1; tftlcd_write_index_register(TS_INS_START_ADX); tftlcd_write_wdr(sx); tftlcd_write_index_register(TS_INS_END_ADX); tftlcd_write_wdr(ex); tftlcd_write_index_register(TS_INS_GRAM_ADX); tftlcd_write_wdr(sx); #if !PORTRAIT sy = TS_SIZE_Y - 1 - sy; // mirror start y address ey = TS_SIZE_Y - 1 - ey; // mirror end y address newY = sy - ey + 1; tftlcd_write_index_register(TS_INS_START_ADY); tftlcd_write_wdr(ey); tftlcd_write_index_register(TS_INS_END_ADY); tftlcd_write_wdr(sy); tftlcd_write_index_register(TS_INS_GRAM_ADY); tftlcd_write_wdr(sy); #else newY = ey - sy + 1; tftlcd_write_index_register(TS_INS_START_ADY); tftlcd_write_wdr(sy); tftlcd_write_index_register(TS_INS_END_ADY); tftlcd_write_wdr(ey); tftlcd_write_index_register(TS_INS_GRAM_ADY); tftlcd_write_wdr(sy); #endif tftlcd_write_index_register(TS_INS_RW_GRAM); } //----------------------------------------------------------------------- // Show A Picture On The LCD Screen (from memory) //----------------------------------------------------------------------- void tftlcd_write_pic(int sx,int sy,int ex,int ey,const unsigned short *pointer) { unsigned int counter_x; unsigned int counter_y; tftlcd_SetArea(sx,ex,sy,ey); for (counter_y=0; counter_y<newY; counter_y++) for (counter_x=0; counter_x<newX; counter_x++) tftlcd_write_wdr((int)*pointer++); } //----------------------------------------------------------------------- // Show A Picture On The LCD Screen (from MMC...) - NOT TESTED! //----------------------------------------------------------------------- void tftlcd_write_mpic(int sx,int sy) { unsigned int ex; unsigned int ey; unsigned int counter_x; unsigned int counter_y; unsigned char buffer[720]; unsigned char res; unsigned int br; ex = sx + bmpWidth-1; ey = sy + bmpHeight-1; tftlcd_write_index_register(TS_INS_ENTRY_MOD); tftlcd_write_wdr(0x0010); tftlcd_SetArea(sx,ex,sy,ey); //------------------- for (counter_y=0; counter_y<newY; counter_y++) { res = f_read(&fil,buffer,newX,&br); if(res) return(res); for (counter_x=0; counter_x<newX; counter_x+=3) { tftlcd_write_wdr((int)( (( buffer[counter_x+2]>>3)<<11) | ((buffer[counter_x+1]>>2)<<5) | (buffer[counter_x]>>3) )); } } //------------------- tftlcd_write_index_register(LCD_INS_ENTRY_MOD); tftlcd_write_wdr(LCD_VAL_ENTRY_MOD); }
( اینجا کدها رو یه کمی درهم نشون میده، کپی کنید توی ادیتور کدتون، درست نشونشون میده! )
موفق باشید

دیدگاه