LVGL keyboard freezes after a few clicks

Hello,
I have a problem with the keyboard. I have the keyboard and 5 button(UP/DOWN/LEFT/RIGHT/ENTER) to launch it I tried to launch it according to the document.
Unfortunately, after pressing the ENTER button several times, the keyboard stops working. And I could not find the problem at all. Please guide me in this matter.

uint8_t my_btn_read(){

uint8_t i=0;

if(UP_KEY==0) i=LV_KEY_UP;
else if(DOWN_KEY==0) i=LV_KEY_DOWN;
else if (RIGHT_KEY==0) i=LV_KEY_RIGHT;
else if(LEFT_KEY==0) i=LV_KEY_LEFT;
else if(ENTER_KEY==0) i=LV_KEY_ENTER;
else i=0;
return (i);

}

void encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t * data){

uint8_t act_key=0;
act_key = my_btn_read() ;
 
if(act_key>0) {
	data->state =LV_INDEV_STATE_PRESSED;
	data->key=act_key ;
}	

else {

  data->state = LV_INDEV_STATE_RELEASED;
  act_key=0;
  data->key=0;
}

}

void Ave_Page1_Create(void) {

   lv_obj_t* kb = lv_keyboard_create(lv_scr_act());
       lv_obj_t* ta;
      ta = lv_textarea_create(lv_scr_act());
      lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 50);
      lv_textarea_set_placeholder_text(ta, "Your name");
      lv_obj_set_size(ta, 400, 80);
      lv_keyboard_set_textarea(kb, ta);
		 

        static lv_indev_t *indev;
		static lv_indev_drv_t indev_drv;	
		lv_indev_drv_init(&indev_drv);
		indev_drv.read_cb=encoder_with_keys_read;
		indev_drv.type=LV_INDEV_TYPE_KEYPAD;
		indev_drv.long_press_repeat_time =100;
                    indev_drv.long_press_time=500;
		indev = lv_indev_drv_register(&indev_drv);
		lv_group_t * g = lv_group_create();
	        lv_group_add_obj(g, kb);
		lv_group_set_default(g);
		lv_indev_set_group(indev, g);

}

int main(void){

...

lv_init();
tft_init();

Ave_Page1_Create();

while(1)
{
lv_tick_inc(1);
lv_timer_handler ();
Delay_ms(2);

}
}

hello,it solved, i just change the compiler and all things were solved.