From: CCC <2393524978@qq.com> Date: Fri, 18 Aug 2023 07:04:22 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=44120a2ec3326ad6fd1e9a9fb5797f19a6419db7;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_nv_interface.c b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_nv_interface.c index e22c3959..be0d9f7c 100644 --- a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_nv_interface.c +++ b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_nv_interface.c @@ -48,13 +48,13 @@ void nv_pedometer_step_data_save(nv_watch_pedometer_step_t * xmo_pedometer) void nv_hr_bp_bo_value_get(nv_watch_hr_bp_bo_t * hr_bp) { //read from nv - UI_NV_Read_Req(NV_SECTION_UI_HR_BP_BO, 0, sizeof(nv_watch_hr_bp_bo_t), (uint8_t *)hr_bp); +// UI_NV_Read_Req(NV_SECTION_UI_HR_BP_BO, 0, sizeof(nv_watch_hr_bp_bo_t), (uint8_t *)hr_bp); } void nv_hr_bp_bo_value_save(nv_watch_hr_bp_bo_t * hr_bp) { //write to nv - UI_NV_Write_Req(NV_SECTION_UI_HR_BP_BO, 0, sizeof(nv_watch_hr_bp_bo_t), (uint8_t *)hr_bp); +// UI_NV_Write_Req(NV_SECTION_UI_HR_BP_BO, 0, sizeof(nv_watch_hr_bp_bo_t), (uint8_t *)hr_bp); } void nv_gps_aidpos_get(nv_watch_gps_aidpos_t * data) 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 b25547a2..612119a1 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 @@ -42,6 +42,8 @@ extern "C" { #define NV_SECTION_UI_SOS_NUMBER_LEN (sizeof(nv_watch_sos_number_t)) #define NV_SECTION_UI_CENTER_NUMBER_LEN (sizeof(nv_watch_center_number_t)) #define NV_SECTION_UI_VC_CONTACT_LEN (sizeof(nv_watch_vc_contact_t)) +#define NV_SECTION_UI_DO_NOT_DISTURB_LEN (sizeof(nv_watch_do_not_disturb_t)) + //#endif #define NV_SECTION_LEN(sectionid) (sectionid ## _LEN) @@ -129,6 +131,8 @@ typedef lv_fs_dir_t ui_dir_t; #define NV_SECTION_UI_SOS_NUMBER_FILE "ui_sos_number.nv" #define NV_SECTION_UI_CENTER_NUMBER_FILE "ui_center_number.nv" #define NV_SECTION_UI_VC_CONTACT_FILE "ui_vc_contact.nv" +#define NV_SECTION_UI_DO_NOT_DISTURB_FILE "ui_do_not_disturb.nv" + //#endif #define NV_SECTION_FILE_PATH(sectionid) (sectionid ## _FILE) 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 96d42f9c..eaebba3f 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 @@ -38,17 +38,17 @@ uint32_t UI_NV_Get_Section_Len(NV_UI_SECTION_ID SectionId) case NV_SECTION_UI_ALARM: return(NV_SECTION_LEN(NV_SECTION_UI_ALARM)); - case NV_SECTION_UI_VOICE_MSG: - return(NV_SECTION_LEN(NV_SECTION_UI_VOICE_MSG)); +// case NV_SECTION_UI_VOICE_MSG: +// return(NV_SECTION_LEN(NV_SECTION_UI_VOICE_MSG)); case NV_SECTION_UI_ENGINEER_MODE: return(NV_SECTION_LEN(NV_SECTION_UI_ENGINEER_MODE)); - case NV_SECTION_UI_BLUETOOTH: - return (NV_SECTION_LEN(NV_SECTION_UI_BLUETOOTH)); +// case NV_SECTION_UI_BLUETOOTH: +// return (NV_SECTION_LEN(NV_SECTION_UI_BLUETOOTH)); - case NV_SECTION_UI_AUDIO_PLAYER: - return (NV_SECTION_LEN(NV_SECTION_UI_AUDIO_PLAYER)); +// case NV_SECTION_UI_AUDIO_PLAYER: +// return (NV_SECTION_LEN(NV_SECTION_UI_AUDIO_PLAYER)); case NV_SECTION_UI_DM: return (NV_SECTION_LEN(NV_SECTION_UI_DM)); @@ -56,8 +56,8 @@ uint32_t UI_NV_Get_Section_Len(NV_UI_SECTION_ID SectionId) case NV_SECTION_UI_CALL_LOG: return (NV_SECTION_LEN(NV_SECTION_UI_CALL_LOG)); - case NV_SECTION_UI_HR_BP_BO: - return(NV_SECTION_LEN(NV_SECTION_UI_HR_BP_BO)); +// case NV_SECTION_UI_HR_BP_BO: +// return(NV_SECTION_LEN(NV_SECTION_UI_HR_BP_BO)); case NV_SECTION_UI_PEDOMETER_STEP: return(NV_SECTION_LEN(NV_SECTION_UI_PEDOMETER_STEP)); @@ -87,6 +87,8 @@ uint32_t UI_NV_Get_Section_Len(NV_UI_SECTION_ID SectionId) return (NV_SECTION_LEN(NV_SECTION_UI_CENTER_NUMBER)); case NV_SECTION_UI_VC_CONTACT: return (NV_SECTION_LEN(NV_SECTION_UI_VC_CONTACT)); + case NV_SECTION_UI_DO_NOT_DISTURB: + return (NV_SECTION_LEN(NV_SECTION_UI_DO_NOT_DISTURB)); //#endif @@ -125,17 +127,17 @@ char * UI_NV_Get_Section_path(NV_UI_SECTION_ID SectionId) case NV_SECTION_UI_ALARM: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_ALARM)); - case NV_SECTION_UI_VOICE_MSG: - return (NV_SECTION_FILE_PATH(NV_SECTION_UI_VOICE_MSG)); +// case NV_SECTION_UI_VOICE_MSG: +// return (NV_SECTION_FILE_PATH(NV_SECTION_UI_VOICE_MSG)); case NV_SECTION_UI_ENGINEER_MODE: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_ENGINEER_MODE)); - case NV_SECTION_UI_BLUETOOTH: - return (NV_SECTION_FILE_PATH(NV_SECTION_UI_BLUETOOTH)); +// case NV_SECTION_UI_BLUETOOTH: +// return (NV_SECTION_FILE_PATH(NV_SECTION_UI_BLUETOOTH)); - case NV_SECTION_UI_AUDIO_PLAYER: - return (NV_SECTION_FILE_PATH(NV_SECTION_UI_AUDIO_PLAYER)); +// case NV_SECTION_UI_AUDIO_PLAYER: +// return (NV_SECTION_FILE_PATH(NV_SECTION_UI_AUDIO_PLAYER)); case NV_SECTION_UI_DM: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_DM)); @@ -143,8 +145,8 @@ char * UI_NV_Get_Section_path(NV_UI_SECTION_ID SectionId) case NV_SECTION_UI_CALL_LOG: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_CALL_LOG)); - case NV_SECTION_UI_HR_BP_BO: - return (NV_SECTION_FILE_PATH(NV_SECTION_UI_HR_BP_BO)); +// case NV_SECTION_UI_HR_BP_BO: +// return (NV_SECTION_FILE_PATH(NV_SECTION_UI_HR_BP_BO)); case NV_SECTION_UI_PEDOMETER_STEP: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_PEDOMETER_STEP)); @@ -174,6 +176,8 @@ char * UI_NV_Get_Section_path(NV_UI_SECTION_ID SectionId) return (NV_SECTION_FILE_PATH(NV_SECTION_UI_CENTER_NUMBER)); case NV_SECTION_UI_VC_CONTACT: return (NV_SECTION_FILE_PATH(NV_SECTION_UI_VC_CONTACT)); + case NV_SECTION_UI_DO_NOT_DISTURB: + return (NV_SECTION_FILE_PATH(NV_SECTION_UI_DO_NOT_DISTURB)); //#endif @@ -220,6 +224,7 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) nv_watch_sos_number_t * sos_number; nv_watch_center_number_t * center_number; nv_watch_vc_contact_t * vc_contact; + nv_watch_do_not_disturb_t * do_not_disturb; //#endif switch(SectionId) { @@ -315,26 +320,26 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) memset(alarm, 0, SectionLen); TempData = (char *)alarm; break; - case NV_SECTION_UI_VOICE_MSG: - voicemsg = lv_mem_alloc(SectionLen); - memset(voicemsg, 0xFF, SectionLen); - TempData = (char *)voicemsg; - break; +// case NV_SECTION_UI_VOICE_MSG: +// voicemsg = lv_mem_alloc(SectionLen); +// memset(voicemsg, 0xFF, SectionLen); +// TempData = (char *)voicemsg; +// break; case NV_SECTION_UI_ENGINEER_MODE: engineermode = lv_mem_alloc(SectionLen); memset(engineermode, 0, SectionLen); TempData = (char *)engineermode; break; - case NV_SECTION_UI_BLUETOOTH: - bluetooth = lv_mem_alloc(SectionLen); - memset(bluetooth, 0, SectionLen); - TempData = (char *)bluetooth; - break; - case NV_SECTION_UI_AUDIO_PLAYER: - audioplayer = lv_mem_alloc(SectionLen); - memset(audioplayer, 0, SectionLen); - TempData = (char *)audioplayer; - break; +// case NV_SECTION_UI_BLUETOOTH: +// bluetooth = lv_mem_alloc(SectionLen); +// memset(bluetooth, 0, SectionLen); +// TempData = (char *)bluetooth; +// break; +// case NV_SECTION_UI_AUDIO_PLAYER: +// audioplayer = lv_mem_alloc(SectionLen); +// memset(audioplayer, 0, SectionLen); +// TempData = (char *)audioplayer; +// break; case NV_SECTION_UI_DM: dm = lv_mem_alloc(SectionLen); memset(dm, 0, SectionLen); @@ -345,11 +350,11 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) memset(calllog, 0, SectionLen); TempData = (char *)calllog; break; - case NV_SECTION_UI_HR_BP_BO: - hr_bp_bo = lv_mem_alloc(SectionLen); - memset(hr_bp_bo, 0, SectionLen); - TempData = (char *)hr_bp_bo; - break; +// case NV_SECTION_UI_HR_BP_BO: +// hr_bp_bo = lv_mem_alloc(SectionLen); +// memset(hr_bp_bo, 0, SectionLen); +// TempData = (char *)hr_bp_bo; +// break; case NV_SECTION_UI_PEDOMETER_STEP: pedometer_step = lv_mem_alloc(SectionLen); memset(pedometer_step, 0, SectionLen); @@ -415,8 +420,16 @@ uint8_t UI_NV_Reset_Default(NV_UI_SECTION_ID SectionId) memset(vc_contact, 0x0, SectionLen); TempData = (char *)vc_contact; break; + + case NV_SECTION_UI_DO_NOT_DISTURB: + do_not_disturb = lv_mem_alloc(SectionLen); + memset(do_not_disturb, 0x0, SectionLen); + TempData = (char *)do_not_disturb; + break; + //#endif + default: TempData = NULL; break; 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 49f74f65..ca2116fa 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 @@ -146,7 +146,7 @@ typedef struct //#ifdef __MMI_ZHSX_SUPPORT__ #define NV_WATCH_WECHAT_NUM_MAX (20) -#define NV_WATCH_WECHAT_DATA_FILE_NAME_MAX (LV_FS_MAX_PATH_LENGTH / 2) +#define NV_WATCH_WECHAT_DATA_FILE_NAME_MAX (64) // (LV_FS_MAX_PATH_LENGTH / 2) typedef enum { @@ -236,6 +236,27 @@ typedef struct } __packed nv_watch_vc_contact_t; +//#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ +#define NV_WATCH_DO_NOT_DISTURB_ITEM_MAX (3) + +typedef struct +{ + uint8_t on_off; // 1: on, 0: off + uint8_t begin_hour; // [0, 23] + uint8_t begin_min; // [0, 59] + uint8_t end_hour; // [0, 23] + uint8_t end_min; // [0, 59] + uint8_t week_bitmap; /* Bit 7: reserved, Bit 0: Sunday, bit 1: Monday ... bit 6: Saturday */ +} __packed nv_watch_do_not_disturb_item_t; + +typedef struct +{ + nv_watch_do_not_disturb_item_t item_info[NV_WATCH_DO_NOT_DISTURB_ITEM_MAX]; +} __packed nv_watch_do_not_disturb_t; +//#endif + + + //#endif typedef struct @@ -369,28 +390,28 @@ typedef struct double altitude; } __packed nv_watch_gps_aidpos_t; -typedef struct -{ - nv_watch_settings_t settings; - nv_watch_phone_t phone; - nv_watch_pedometer_t pedometer; - nv_watch_launcher_t launcher; - nv_watch_phonebook_t phonebook; - nv_watch_factorymode_t factorymode; - nv_watch_alarm_t alarm; - nv_watch_voice_msg_t voicemsg; - nv_watch_engineer_mode_t engineermode; - nv_watch_bluetooth_t bluetooth; - nv_watch_audio_player_t audioplayer; - nv_watch_dm_t dm; - nv_watch_call_log_t calllog; - //Simware - nv_watch_hr_bp_bo_t hr_and_bp; - nv_watch_pedometer_step_t pedometer_step; - nv_watch_agnss_t watch_agnss; - nv_watch_sms_msg_t sms_msg; - nv_watch_gps_aidpos_t gps_aidpos; -} __packed nv_watch_stru_t; +//typedef struct +//{ +// nv_watch_settings_t settings; +// nv_watch_phone_t phone; +// nv_watch_pedometer_t pedometer; +// nv_watch_launcher_t launcher; +// nv_watch_phonebook_t phonebook; +// nv_watch_factorymode_t factorymode; +// nv_watch_alarm_t alarm; +// nv_watch_voice_msg_t voicemsg; +// nv_watch_engineer_mode_t engineermode; +// nv_watch_bluetooth_t bluetooth; +// nv_watch_audio_player_t audioplayer; +// nv_watch_dm_t dm; +// nv_watch_call_log_t calllog; +// //Simware +// nv_watch_hr_bp_bo_t hr_and_bp; +// nv_watch_pedometer_step_t pedometer_step; +// nv_watch_agnss_t watch_agnss; +// nv_watch_sms_msg_t sms_msg; +// nv_watch_gps_aidpos_t gps_aidpos; +//} __packed nv_watch_stru_t; enum { @@ -401,14 +422,14 @@ enum NV_SECTION_UI_PHONEBOOK, // nv_watch_phonebook_t NV_SECTION_UI_FACTORYMODE, // nv_watch_factorymode_t NV_SECTION_UI_ALARM, // nv_watch_alarm_t - NV_SECTION_UI_VOICE_MSG, // nv_watch_voice_msg_t +// NV_SECTION_UI_VOICE_MSG, // nv_watch_voice_msg_t NV_SECTION_UI_ENGINEER_MODE, // nv_watch_engineer_mode_t - NV_SECTION_UI_BLUETOOTH, // nv_watch_bluetooth_t - NV_SECTION_UI_AUDIO_PLAYER, // nv_watch_audio_player_t +// NV_SECTION_UI_BLUETOOTH, // nv_watch_bluetooth_t +// NV_SECTION_UI_AUDIO_PLAYER, // nv_watch_audio_player_t NV_SECTION_UI_DM, // nv_watch_dm_t NV_SECTION_UI_CALL_LOG, // nv_watch_call_log_t //Simware - NV_SECTION_UI_HR_BP_BO, // nv_watch_hr_bp_bo_t +// NV_SECTION_UI_HR_BP_BO, // nv_watch_hr_bp_bo_t NV_SECTION_UI_PEDOMETER_STEP, // nv_watch_pedometer_step_t NV_SECTION_UI_AGNSS, // nv_watch_agnss_t NV_SECTION_UI_SMSMSG, // nv_watch_sms_msg_t @@ -421,6 +442,10 @@ enum NV_SECTION_UI_SOS_NUMBER, // nv_watch_sos_number_t NV_SECTION_UI_CENTER_NUMBER, // nv_watch_center_number_t NV_SECTION_UI_VC_CONTACT, // nv_watch_vc_contact_t + //#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + NV_SECTION_UI_DO_NOT_DISTURB, // nv_watch_do_not_disturb_t + //#endif + //#endif NV_SECTION_UI_MAX_NUM 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 e1add6aa..5e3e3c1f 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 @@ -613,6 +613,15 @@ void mmi_ui_msg_update_charging_prompt(uint32_t chg_status) { SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, chg_status); + if(true == mmi_active_screen_is_prohibit_interrupted() + #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + || true == mmi_watch_is_in_do_not_disturb_time() + #endif + ) + { + return ; + } + if(HAL_CHG_CONNECTED == (HAL_CHG_STATUS)chg_status || HAL_CHG_DISCONNECTED == (HAL_CHG_STATUS)chg_status) { mmi_watch_charging_prompt_screen_prepare_destory(NULL);