From: @HU <1224667075@qq.com> Date: Mon, 8 Jan 2024 11:36:44 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=ef410cc20718ad92fdf7542a07fd78e6cb126c51;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c index 53f8c289..08396cc5 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c @@ -412,7 +412,9 @@ void mmi_hengai_bp_calibrate_raw_data_send(uint8_t calibrate_times, uint16_t bp_ temp_len += sprintf(post_data + temp_len, "\"sbp\":%d,", bp_value_high); - temp_len += sprintf(post_data + temp_len, "\"dbp\":%d}", bp_value_low); + temp_len += sprintf(post_data + temp_len, "\"dbp\":%d,", bp_value_low); + + temp_len += sprintf(post_data + temp_len, "\"category\":%d}", calibrate_times); #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.c b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.c index 5ce3825f..ad9089b3 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.c @@ -40,11 +40,80 @@ static mmi_remind_screen_info_t s_remind_info[] = { MMI_REMIND_TYPE_MAX, 0, NULL, NULL}, }; +#ifdef __MMI_REMIND_take_off_SUPPORT__ + +static void * take_off_remind_timer = NULL; +static bool take_on_or_off; + +static void mmi_sedentary_remind_trigger(uint32_t para); + +void mmi_take_off_remind_timer_stop(void) +{ + if(NULL != take_off_remind_timer) + { + uos_timer_stop(take_off_remind_timer); + take_off_remind_timer=NULL; + + } +} + +static void mmi_take_off_remind_trigger(uint32_t para) +{ + + if(true != mmi_health_measure_wear_state_get() && take_on_or_off==true) + { + watch_wakeup_lcd(true); + mmi_protocol_action_take_off(); + printf("test_take_off %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off); + take_on_or_off=false; + } + else if(true == mmi_health_measure_wear_state_get() && take_on_or_off!=true) + { + watch_wakeup_lcd(true); + //mmi_protocol_action_take_on(); + //printf("test_take_off %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off); + take_on_or_off=true; + } + + printf("test_take_off________1111 %d or %d \n",mmi_health_measure_wear_state_get(),take_on_or_off); + mmi_take_off_remind_timer_start(); +} + + + +void mmi_take_off_remind_timer_start(void) +{ + //take_on_or_off=mmi_health_measure_wear_state_get(); + if(NULL != take_off_remind_timer) + uos_timer_stop(take_off_remind_timer); + else + uos_timer_create(&take_off_remind_timer); + uos_timer_start(take_off_remind_timer, MS_TO_TICKS(1 * 60 * 1000), 0, mmi_take_off_remind_trigger, NULL); +} + +void mmi_take_off_remind_init(void) +{ + + if(mmi_take_off_switch_get()) + { + printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__); + take_on_or_off=mmi_health_measure_wear_state_get(); + mmi_take_off_remind_timer_start(); + + } + +} + + + +#endif + #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ static nv_watch_remind_item_t s_remind_wake_up_data = {0}; + void mmi_remind_wake_up_nv_write(void) { uint32_t nv_data_length = sizeof(nv_watch_remind_item_t); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.h b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.h index dd21b828..296ff962 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/mmi_remind/mmi_remind.h @@ -88,6 +88,25 @@ void mmi_remind_screen_active(void); void mmi_remind_mission_check(hal_rtc_t cur_time); void mmi_remind_data_init(void); +#ifdef __MMI_REMIND_take_off_SUPPORT__ + +void mmi_take_off_remind_timer_stop(void); + + +static void mmi_take_off_remind_trigger(uint32_t para); + + +void mmi_take_off_remind_timer_start(void); + + +void mmi_take_off_remind_init(void); + + +#endif + + + + #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu.c b/2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu.c index 92ac5c81..f457eceb 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu.c @@ -350,11 +350,13 @@ static lv_obj_t * mmi_main_menu_style_list_display(lv_obj_t * tab) lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL); #ifdef USE_LV_WATCH_UI_466_466 lv_obj_set_width(label, lv_obj_get_width(btn) - 100); + lv_label_set_text_id(label, s_main_menu_list[i].txtId); + lv_obj_align(label, img, LV_ALIGN_OUT_RIGHT_MID, 15, 0); #else // USE_LV_WATCH_UI_240_240 lv_obj_set_width(label, lv_obj_get_width(btn) - 70); - #endif lv_label_set_text_id(label, s_main_menu_list[i].txtId); lv_obj_align(label, img, LV_ALIGN_OUT_RIGHT_MID, 10, 0); + #endif #endif } diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.c b/2.sdk/sdk/gui/lv_watch/lv_watch.c index 47b89c57..b086ae45 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.c +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.c @@ -569,6 +569,10 @@ static lv_obj_t * watch_create(bool silentReset) #ifdef __MMI_ZHSX_SUPPORT__ mmi_data_init_after_watch_create(); #endif +#ifdef __MMI_REMIND_WAKE_UP_take_off_SUPPORT__ +printf("123456789"); + mmi_take_off_remind_init(); +#endif return obj; } diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c index 77250dea..73260dcd 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c @@ -3065,6 +3065,18 @@ bool mmi_protocol_fzd_parse_SERVER_SET_TAKE_OFF_SWITCH(unsigned char * next_buff uint32_t value = atoi(next_buff); mmi_take_off_switch_set(value); + #ifdef __MMI_REMIND_take_off_SUPPORT__ + if(value) + { + mmi_take_off_remind_init(); + } + else + { + mmi_take_off_remind_timer_stop(); + } + #endif + + return result; } diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c index ceeb0766..01e52b05 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c @@ -363,10 +363,11 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned case MMI_FZD_SERVER_SET_FALL_DOWN_SWITCH: mmi_protocol_fzd_parse_SERVER_SET_FALL_DOWN_SWITCH(next_buff, next_buff_len); break; - + #ifdef __MMI_REMIND_take_off_SUPPORT__ case MMI_FZD_SERVER_SET_TAKE_OFF_SWITCH: mmi_protocol_fzd_parse_SERVER_SET_TAKE_OFF_SWITCH(next_buff, next_buff_len); break; + #endif #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ case MMI_FZD_SERVER_SET_REMIND_WAKE_UP: