Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions display/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static struct fb_fix_screeninfo finfo;
static char *fbp = 0;
static long int screensize = 0;
static int fbfd = 0;
static bool force_refresh = false;

/**********************
* MACROS
Expand Down Expand Up @@ -161,6 +162,10 @@ void fbdev_init(void)

}

void fbdev_force_refresh(bool enabled) {
force_refresh = enabled;
}

void fbdev_exit(void)
{
close(fbfd);
Expand Down Expand Up @@ -263,8 +268,12 @@ void fbdev_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color
/*Not supported bit per pixel*/
}

//May be some direct update command is required
//ret = ioctl(state->fd, FBIO_UPDATE, (unsigned long)((uintptr_t)rect));
if (force_refresh) {
vinfo.activate |= FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &vinfo) == -1) {
perror("Error setting var screen info");
}
}

lv_disp_flush_ready(drv);
}
Expand Down
5 changes: 5 additions & 0 deletions display/fbdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ void fbdev_get_sizes(uint32_t *width, uint32_t *height, uint32_t *dpi);
*/
void fbdev_set_offset(uint32_t xoffset, uint32_t yoffset);

/**
* Force the display to be refreshed on every change.
* Expected to be used with direct_mode or full_refresh.
*/
void fbdev_force_refresh(bool enabled);

/**********************
* MACROS
Expand Down
Loading