Animation issue

Hi All,

I am Using LVGL 8.3 Version able display image with LVGL but when i am using simple LVGL animation .the animation is not coming proper. driver IC used RM69600.
i attached video clip with simple playback animation

playbackanimation

regards,
Raja
play_animation-ezgif.com-resize

Hi,

Probably it’s a display driver issue. Please share your flush_cb.

Hi @kisvegabor ,
i attached the flush_cb function . i am able to display the obj and images ,I’m facing issue when animating that obj [the animation takes place but distorted one].

static void flush_cb(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
cy_rslt_t result;

RM69600_SetWindow(area->x1, area->x2, area->y1, area->y2);
int height = area->y2 - area->y1 + 1;
int width = area->x2 - area->x1 + 1;

RM69700_DrawBitmap( width, height,(uint8_t *)color_p);
/* Indicate that the flush is ready */
lv_disp_flush_ready(drv);

}

void RM69600_SetWindow(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end) {
#if 1
// Set column address
lcd_write_index(0x2A); // Column address set command
lcd_write_data(x_start >> 8); // Start column high byte
lcd_write_data(x_start & 0xFF); // Start column low byte
lcd_write_data(x_end >> 8); // End column high byte
lcd_write_data(x_end & 0xFF); // End column low byte

// Set page address
lcd_write_index(0x2B); // Page address set command
lcd_write_data(y_start >> 8); // Start row high byte
lcd_write_data(y_start & 0xFF); // Start row low byte
lcd_write_data(y_end >> 8); // End row high byte
lcd_write_data(y_end & 0xFF); // End row low byte

// Start memory write
lcd_write_index(0x2C); // Memory write command
#endif

}

able to rendering the image but only issue with animation… i attached the image.

Try change

RM69700_DrawBitmap( width, height,(uint16_t *)&color_p->full);

and sure DrawBitmap dont use DMA?

void RM69700_DrawBitmap(uint16_t w, uint16_t h, uint8_t s)
{
while (cyhal_spi_is_busy(&mSPI)) {
// wait Untill the spi bus free
}
// Enable to access GRAM
lcd_write_index(0x2c);
cyhal_gpio_write(CYBSP_D9,1); // DCx pin
ConvHL(s, (int32_t)w
h2);
for(uint32_t i=0;i<w
h*2;i++)
{
cyhal_spi_send(&mSPI,s[i]);
}
cyhal_gpio_write(CYBSP_D9,0); // DCx pin
}

This function i have updated to below functions

void RM69700_DrawBitmap(uint16_t w, uint16_t h, uint16_t s)
{
while (cyhal_spi_is_busy(&mSPI)) {
// wait Untill the spi bus free
}
// Enable to access GRAM
lcd_write_index(0x2c);
cyhal_gpio_write(CYBSP_D9,1);
ConvHL(s, (int32_t)w
h2);
for(uint32_t i=0;i<w
h*2;i++)
{
cyhal_spi_send(&mSPI,s[i]);
}
cyhal_gpio_write(CYBSP_D9,0);
}

void ConvHL(uint8_t *s, int32_t l)
{
uint8_t v;
while (l > 0) {
v = *(s+1);
*(s+1) = *s;
*s = v;
s += 2;
l -= 2;
}
}

no still issue is there on animation…

Depending on the display controller you might need to add +1 to x_end and y_end in RM69600_SetWindow. Could you give it a try?

i made changes its not working more corrupted animation…

static void flush_cb(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
cy_rslt_t result;

RM69600_SetWindow(area->x1, area->x2+1, area->y1, area->y2+1);

int height = area->y2 - area->y1+1;
int width = area->x2 - area->x1+1;

printf("X1=%d,X2=%d,Y1=%d,Y2=%d\r\n",area->x1, area->x2, area->y1, area->y2);
RM69700_DrawBitmap( width, height,(uint8_t *)color_p);

/* Indicate that the flush is ready */
lv_disp_flush_ready(drv);

}

Okay, thank you! So it works when the whole screen is updated but not when a small areas change. What happens if you create just a button and press it?

we are not using touch so… iam using external gpio interrupt to increment the count value…
below i attcahed the videos,on every click/press of button I’m updating the count and displaying that as label on it . but it comes distorted.

void mlv_example_event_1(void)
{
btn = lv_btn_create(lv_scr_act());

lv_obj_set_size(btn, 80, 40);
lv_obj_center(btn);
label = lv_label_create(btn);
lv_label_set_text(label, "Click me!");
lv_obj_center(label);

}
// External Interrupt
if(gpio_intr_flag == true)
{
gpio_intr_flag = false;
static uint32_t cnt = 1;
lv_obj_invalidate(label);
lv_label_set_text_fmt(label, "%"LV_PRIu32, cnt);
cnt++;
}

MicrosoftTeams-video-ezgif.com-resize

It’s a little bit small so it’s hard to see but it should be an off by one issue in window setting or sending the colors.

Maybe in RM69700_DrawBitmap width should one more or one less?

if(gpio_intr_flag == true)
{
gpio_intr_flag = false;
static uint32_t cnt = 1;’
llv_obj_t * label = lv_label_create(btn);
lv_obj_invalidate(label);
lv_label_set_text_fmt(label, "%"LV_PRIu32, cnt);
cnt++;
}
if we’re creating the label object locally it’s working fine it the above case. but for animation we need to have one obj globally and as we’re changing the position,size the same defected Animation comes. but other animation like opacity is working fine.

need be , maybe is but is inserted as text and not visible here

void RM69700_DrawBitmap(uint16_t w, uint16_t h, uint16_t *s)

and mlv_example hmm lv_label_create on every event ??? You go out of memory …
Try use Squareline and learn how right code look.

static void flush_cb(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_p)
{
if(area->x2 < 0) return;
if(area->y2 < 0) return;
if(area->x1 > DISP_HOR_RES - 1) return;
if(area->y1 > DISP_VER_RES - 1) return;
#if 1 // set & draw function

RM69600_SetWindow(area->x1, area->x2-1, area->y1, area->y2-1);
int height = area->y2 - area->y1;
int width = area->x2 - area->x1;
RM69700_DrawBitmap(width, height,(uint8_t *)color_p);

#endif
/* Indicate that the flush is ready */
lv_disp_flush_ready(drv);
}

after correcting some how animation is coming proper … little bit glitches are there in animations means privious animation animations retains even after new animtions comes

1 Like