mcu_ab568x/app/projects/AB5682C_240/functions/func_bt_end.c
2025-05-30 18:03:10 +08:00

109 lines
2.5 KiB
C

#include "include.h"
#include "func.h"
#if TRACE_EN
#define TRACE(...) printf(__VA_ARGS__)
#else
#define TRACE(...)
#endif
#define BT_END_CARD_WIDTH_ORG 200
#define BT_END_CARD_HEIGHT_ORG 110
typedef struct f_bt_endt_ {
u32 enter_tick;
} f_bt_endt;
static void func_bt_call_back_to(void)
{
u8 last_func = func_directly_back_to();
if (last_func == FUNC_BT_RING) {
func_directly_back_to();
}
}
//创建logo窗体
compo_form_t *func_bt_end_form_create(void)
{
//新建窗体
compo_cardbox_t *cardbox;
compo_form_t *frm = compo_form_create(true);
cardbox = compo_cardbox_create(frm, 1, 1, 2, BT_END_CARD_WIDTH_ORG, BT_END_CARD_HEIGHT_ORG);
compo_cardbox_set_pos(cardbox, GUI_SCREEN_CENTER_X,GUI_SCREEN_CENTER_Y);
compo_cardbox_rect_set_location(cardbox, 0, 0, 0, BT_END_CARD_WIDTH_ORG, BT_END_CARD_HEIGHT_ORG, 20);
compo_cardbox_rect_set_color(cardbox, 0, make_color(64,64,64));
compo_cardbox_text_set(cardbox, 0, i18n[STR_CALL_ENDING]); //通话结束
compo_cardbox_text_set_location(cardbox, 0, 0, 0 , BT_END_CARD_WIDTH_ORG, 20);
return frm;
}
static void func_bt_end_animation(void)
{
if(tick_check_expire(func_cb.enter_tick, 3000)) {
func_bt_call_back_to();
}
}
//logo事件处理
static void func_bt_end_process(void)
{
func_bt_end_animation();
func_process();
}
//logo消息处理
static void func_bt_end_message(size_msg_t msg)
{
switch (msg) {
case MSG_CTP_CLICK:
break;
case MSG_CTP_SHORT_UP:
break;
case MSG_CTP_SHORT_DOWN:
break;
case MSG_CTP_LONG:
break;
default:
func_message(msg);
break;
}
}
//进入logo
static void func_bt_end_enter(void)
{
func_cb.f_cb = func_zalloc(sizeof(f_bt_endt));
func_cb.frm_main = func_bt_end_form_create();
func_cb.enter_tick = tick_get();
}
//退出logo
static void func_bt_end_exit(void)
{
func_cb.last = FUNC_BT_END;
}
//logo
void func_bt_end(void)
{
printf("%s\n", __func__);
func_bt_end_enter();
task_stack_del(task_stack_find(FUNC_BT_RING));
// task_stack_del(task_stack_find(FUNC_BT_END));
task_stack_del(task_stack_find(FUNC_BT_CALL));
while (func_cb.sta == FUNC_BT_END) {
func_bt_end_process();
func_bt_end_message(msg_dequeue());
}
func_bt_end_exit();
}