From: @CHENG <2393524978@qq.com> Date: Fri, 23 Feb 2024 09:35:53 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=ca51705a43f635a5bc440875798deb92d5c34143;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h b/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h index 8ff00bda..4336b420 100644 --- a/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h +++ b/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h @@ -203,6 +203,9 @@ #define __MMI_PEDOMETER_STEP_AND_GOAL_STYLE__ +#define __MMI_SLEEP_FUNCTION_SUPPORT__ +#define __MMI_CUSTOM_HENGAI_SLEEP__ + #define __MMI_CUSTOM_HENGAI_HEALTH__ #define __MMI_CUSTOM_HENGAI_TCMS__ diff --git a/2.sdk/project/Z5_HA_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h b/2.sdk/project/Z5_HA_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h index f4e34b36..8ca46de8 100644 --- a/2.sdk/project/Z5_HA_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h +++ b/2.sdk/project/Z5_HA_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h @@ -198,6 +198,7 @@ #ifdef __MMI_CUSTOM_HENG_AI__ #define __MMI_REMIND_WAKE_UP_SUPPORT__ #define __MMI_SLEEP_FUNCTION_SUPPORT__ +#define __MMI_CUSTOM_HENGAI_SLEEP__ #endif diff --git a/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm.h b/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm.h index 55efb74c..59daaf4f 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm.h +++ b/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm.h @@ -87,6 +87,8 @@ extern "C" { #endif #ifdef __MMI_CUSTOM_HENG_AI__ #define NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE_LEN (sizeof(nv_watch_switch_t)) +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ #define NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION_LEN (sizeof(nv_watch_heng_ai_sleep_activation_t)) #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ @@ -226,6 +228,8 @@ typedef lv_fs_dir_t ui_dir_t; #endif #ifdef __MMI_CUSTOM_HENG_AI__ #define NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE_FILE "ui_heng_ai_wake_ring_type.nv" +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ #define NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION_FILE "ui_heng_ai_sleep_activation.nv" #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ diff --git a/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm_api.c b/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm_api.c index 994860f3..4f194062 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm_api.c +++ b/2.sdk/sdk/gui/lv_watch/framework/nvm/ui_nvm_api.c @@ -147,6 +147,8 @@ uint32_t UI_NV_Get_Section_Len(NV_UI_SECTION_ID SectionId) #ifdef __MMI_CUSTOM_HENG_AI__ case NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE: return (NV_SECTION_LEN(NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE)); + #endif + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ case NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION: return (NV_SECTION_LEN(NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION)); #endif @@ -302,6 +304,8 @@ char * UI_NV_Get_Section_path(NV_UI_SECTION_ID SectionId) #ifdef __MMI_CUSTOM_HENG_AI__ case NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE)); + #endif + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ case NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION)); #endif @@ -397,7 +401,7 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) #ifdef __MMI_REMIND_DRINK_SUPPORT__ nv_watch_remind_drink_t * remind_drink_data; #endif -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ nv_watch_heng_ai_sleep_activation_t * heng_ai_sleep_activation; #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ @@ -723,6 +727,8 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) memset(mmi_switch_data, 0x0, SectionLen); TempData = (char *)mmi_switch_data; break; + #endif + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ case NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION: heng_ai_sleep_activation = lv_mem_alloc(SectionLen); memset(heng_ai_sleep_activation, 0x0, SectionLen); diff --git a/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h b/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h index 25709b42..a9e8e3c0 100644 --- a/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h +++ b/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h @@ -444,7 +444,7 @@ typedef struct } __packed nv_watch_not_clean_data_t; -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ typedef struct { uint8_t is_activated; // 0-not activated; 1-activated @@ -702,6 +702,8 @@ enum #endif #ifdef __MMI_CUSTOM_HENG_AI__ NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE, // nv_watch_switch_t +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION, // nv_watch_heng_ai_sleep_activation_t #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c index ad51f6cc..ec5b3357 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c @@ -7,6 +7,8 @@ #ifdef __MMI_CUSTOM_HENG_AI__ #include "heng_ai.c" +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ #include "heng_ai_sleep_activation.c" #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h index 1d4d8be6..befcea40 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h @@ -21,6 +21,8 @@ extern "C" { #ifdef __MMI_CUSTOM_HENG_AI__ #include "heng_ai.h" +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ #include "heng_ai_sleep_activation.h" #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.c index 82d1b88a..b55b74fb 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.c @@ -3,7 +3,7 @@ #include "lv_watch.h" -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ #include "../../../../product/craneg_modem/cust/heng_ai_sleep/inc/lib_sleep.h" diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.h index 09e66e4c..addd4c0f 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.h @@ -16,7 +16,7 @@ extern "C" { #include "../../../lv_ex_conf.h" #endif -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ void mmi_hengai_sleep_activation_nv_read(void); 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 9fd45847..55a5ca3a 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 @@ -663,7 +663,7 @@ bool mmi_protocol_fzd_parse_ACTION_BIND(unsigned char * next_buff, unsigned int #endif // hengai sleep - #ifdef __MMI_CUSTOM_HENG_AI__ + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ mmi_hengai_sleep_activation_check_action(); #endif @@ -912,15 +912,15 @@ bool mmi_protocol_fzd_parse_SERVER_SET_CALL(unsigned char * next_buff, unsigned mmi_protocol_fzd_send_without_data(action); uos_sleep(10); - char * number = (char *)lv_mem_alloc(next_buff_len + 1); + char * number = (char *)lv_mem_alloc(NV_CONTACTS_MAX_NUMBER_LEN); if(NULL == number) { PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); return false; } - _lv_memset_00(number, next_buff_len + 1); - _lv_memcpy(number, next_buff, next_buff_len + 1); - //phone_voice_call_req(number); + _lv_memset_00(number, NV_CONTACTS_MAX_NUMBER_LEN); + _lv_memcpy(number, next_buff, ((NV_CONTACTS_MAX_NUMBER_LEN > next_buff_len) ? next_buff_len : NV_CONTACTS_MAX_NUMBER_LEN - 1)); + phone_voice_call_req(number); return result; } @@ -3487,7 +3487,15 @@ bool mmi_protocol_fzd_parse_SERVER_SET_REMIND_DRINK(unsigned char * next_buff, u nv_watch_remind_drink_t t_data = {0}; char * temp_ptr = NULL; - temp_ptr = km_strtok_r(NULL, "-", &next_buff); + // compatible '-' & ',' + if(NULL != strchr(next_buff, '-')) + { + temp_ptr = km_strtok_r(NULL, "-", &next_buff); + } + else + { + temp_ptr = km_strtok_r(NULL, ",", &next_buff); + } t_data.hour_value = atoi(temp_ptr); temp_ptr = next_buff; @@ -3567,8 +3575,9 @@ bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WARNING(unsigned char * next_buff return result; } +#endif - +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ // [*HENGAI_ACTIVATION, name, model, firm, sensor,fs, sinklib_version, request_code] bool mmi_protocol_fzd_action_hengai_activation(char * req_code) { diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h index 6559943f..588b7312 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h @@ -186,6 +186,8 @@ typedef enum MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW, MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE, MMI_FZD_SERVER_SET_HENG_AI_WARNING, +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ MMI_FZD_ACTION_HENGAI_ACTIVATION, MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK, MMI_FZD_ACTION_HENGAI_SLEEP_DATA, @@ -343,6 +345,8 @@ bool mmi_protocol_fzd_parse_SERVER_SET_REMIND_DRINK(unsigned char * next_buff, u bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_NOW(unsigned char * next_buff, unsigned int next_buff_len); bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_RING_TYPE(unsigned char * next_buff, unsigned int next_buff_len); bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WARNING(unsigned char * next_buff, unsigned int next_buff_len); +#endif +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ bool mmi_protocol_fzd_action_hengai_activation(char * req_code); bool mmi_protocol_fzd_parse_ACTION_HENGAI_ACTIVATION(unsigned char * next_buff, unsigned int next_buff_len); bool mmi_protocol_fzd_action_hengai_activation_feedback(void); 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 3636d2a4..147dcdeb 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 @@ -118,6 +118,8 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO {MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW, "HENG_AI_WAKE_NOW"}, {MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE, "HENG_AI_WAKE_RING_TYPE"}, {MMI_FZD_SERVER_SET_HENG_AI_WARNING, "HENGAI_WARNING"}, + #endif + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ {MMI_FZD_ACTION_HENGAI_ACTIVATION, "HENGAI_ACTIVATION"}, {MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK, "HENGAI_ACTIVATION_FEEDBACK"}, {MMI_FZD_ACTION_HENGAI_SLEEP_DATA, "HENGAI_SLEEP_DATA"}, @@ -425,7 +427,9 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned case MMI_FZD_SERVER_SET_HENG_AI_WARNING: mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WARNING(next_buff, next_buff_len); break; + #endif + #ifdef __MMI_CUSTOM_HENGAI_SLEEP__ case MMI_FZD_ACTION_HENGAI_ACTIVATION: mmi_protocol_fzd_parse_ACTION_HENGAI_ACTIVATION(next_buff, next_buff_len); break; diff --git a/2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c b/2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c index 82936cd0..fb2214f0 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c @@ -1270,7 +1270,7 @@ bool mmi_watch_time_is_in_sleep_time(void) static void mmi_watch_get_sleep_data_start(void) { -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ mmi_hengai_get_sleep_data_start(); #endif @@ -1278,7 +1278,7 @@ static void mmi_watch_get_sleep_data_start(void) static void mmi_watch_get_sleep_data_stop(void) { -#ifdef __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENGAI_SLEEP__ mmi_hengai_get_sleep_data_stop(); #endif