-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LVGL控件边缘出现莫名亮点 #315
Comments
This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
/中文 start**********/ /English start**********/ /English END**********/ |
/中文 start**********/ /English start**********/ The bottom code is the perfect solution /English END**********/ void ili9488_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map)
{
uint32_t size = lv_area_get_width(area) * lv_area_get_height(area);
lv_color16_t *buffer_16bit = (lv_color16_t *) color_map;
static uint8_t *mybuf = NULL;
if (mybuf != NULL){
disp_wait_for_pending_transactions();//等待发完后重新申请地址
heap_caps_free(mybuf);
mybuf = NULL;
}
do {
mybuf = (uint8_t *) heap_caps_malloc(3 * size * sizeof(uint8_t), MALLOC_CAP_DMA);
if (mybuf == NULL) ESP_LOGW(TAG, "Could not allocate enough DMA memory!");
} while (mybuf == NULL);
uint32_t LD = 0;
uint32_t j = 0;
for (uint32_t i = 0; i < size; i++) {
LD = buffer_16bit[i].full;
mybuf[j] = (uint8_t) (((LD & 0xF800) >> 8) | ((LD & 0x8000) >> 13));
j++;
mybuf[j] = (uint8_t) ((LD & 0x07E0) >> 3);
j++;
mybuf[j] = (uint8_t) (((LD & 0x001F) << 3) | ((LD & 0x0010) >> 2));
j++;
}
/* Column addresses */
uint8_t xb[] = {
(uint8_t) (area->x1 >> 8) & 0xFF,
(uint8_t) (area->x1) & 0xFF,
(uint8_t) (area->x2 >> 8) & 0xFF,
(uint8_t) (area->x2) & 0xFF,
};
/* Page addresses */
uint8_t yb[] = {
(uint8_t) (area->y1 >> 8) & 0xFF,
(uint8_t) (area->y1) & 0xFF,
(uint8_t) (area->y2 >> 8) & 0xFF,
(uint8_t) (area->y2) & 0xFF,
};
/*Column addresses*/
ili9488_send_cmd(ILI9488_CMD_COLUMN_ADDRESS_SET);
ili9488_send_data(xb, 4);
/*Page addresses*/
ili9488_send_cmd(ILI9488_CMD_PAGE_ADDRESS_SET);
ili9488_send_data(yb, 4);
/*Memory write*/
ili9488_send_cmd(ILI9488_CMD_MEMORY_WRITE);
ili9488_send_color((void *) mybuf, size * 3);
// heap_caps_free(mybuf);
} |
LVGL控件边缘出现莫名亮点,并且这样的问题会随着设置LVGL初始化时候的缓冲buff大小而改变点点的数量,当把缓冲减小的时候点点就会明显变多,buff越大,点点越小,我使用的是ESP32S3芯片,采用LVGL8.3模板,以下是buff设置大小不同的情况
The text was updated successfully, but these errors were encountered: