How can I change the orientation (landscape/portrait) of a SWIM project?

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

How can I change the orientation (landscape/portrait) of a SWIM project?

1,530 次查看
lpcware-support
Senior Contributor I

SWIM only works in the native display’s memory format and won’t write in landscape format on a portrait frame buffer configuration.

However, as a workaround, you can generate a dummy frame buffer in landscape format and use SWIM to write to that and then occasionally copy that buffer to the real portrait frame buffer, reorganizing the pixels in the copy. This won’t be fast, but it will allow evaluation of SWIM in landscape mode.

Something like this:
uint16_t dummy_fb[320][240];
uint16_t real_fb[240][ 320];
LCD->CURRFB = real_fb;

/* Setup SWIM with dummy_fb */

/* periodically call this */
void move_dummy_fb_to_real_fb(void)
{
    int x, y;

    for (x = 0; x < 320; x++) {
        for (y = 0; y < 240; y++) {
            real_fb[y][x] = dummy_fb[x][y];
        }
    }
}

标签 (1)
标记 (1)
0 项奖励
回复
0 回复数