Description
Simulator
What do you experience?
when I use function lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del) to achieve screens switch, if I set the parameter 'delay' to be 1000, then I switch quickly, then the project will memory out.if I set the parameter 'delay' to be 0,it
s right.
What do you expect?
please help me
Code to reproduce
#include "running.h"
static void touch_event_test(lv_obj_t* obj, lv_event_t event);
static void touch_event_test1(lv_obj_t* obj, lv_event_t event);
/**
* running first page
* @param void
* @return the running first page
*/
lv_obj_t* running_first_page(void)
{
//get sports ring background
lv_obj_t* scr = get_background(NULL);// sport_ring_common();
sports_set_time(scr, 0, 0, 0);
lv_obj_set_event_cb(scr, touch_event_test);
return scr;
}
/**
* running second page
* @param void
* @return the running second page
*/
lv_obj_t* running_second_page(void)
{
//get sports ring background
lv_obj_t* scr = get_background(NULL);//sport_ring_common();
sports_set_rt_speed_allocation(scr, 0, 0);
lv_obj_set_event_cb(scr, touch_event_test1);
return scr;
}
/**
* running second page
* @param void
* @return the running second page
*/
lv_obj_t* running_third_page(void)
{
//get sports ring background
lv_obj_t* scr = sport_ring_common();
sports_set_locate_bg(scr);
return scr;
}
static void touch_event_test(lv_obj_t* obj, lv_event_t event)
{
LV_LOG_USER("\r\nevent %d\r\n", event);
if (event == LV_EVENT_GESTURE)
{
memory_print();
lv_gesture_dir_t dir = lv_indev_get_gesture_dir(lv_indev_get_next(NULL));
switch (dir) {
case LV_GESTURE_DIR_LEFT:
lv_scr_load_anim(running_second_page(), LV_SCR_LOAD_ANIM_OVER_LEFT, 400, 1000, true);
break;
case LV_GESTURE_DIR_RIGHT:
lv_scr_load_anim(running_second_page(), LV_SCR_LOAD_ANIM_OVER_RIGHT, 400, 1000, true);
break;
}
}
}
static void touch_event_test1(lv_obj_t* obj, lv_event_t event)
{
if (event == LV_EVENT_GESTURE)
{
memory_print();
lv_gesture_dir_t dir = lv_indev_get_gesture_dir(lv_indev_get_next(NULL));
switch (dir) {
case LV_GESTURE_DIR_LEFT:
lv_scr_load_anim(running_first_page(), LV_SCR_LOAD_ANIM_OVER_LEFT, 400, 1000, true);
break;
case LV_GESTURE_DIR_RIGHT:
lv_scr_load_anim(running_first_page(), LV_SCR_LOAD_ANIM_OVER_RIGHT, 400, 1000, true);
break;
}
}
}