}
+uint32_t mmi_sleep_roll_number_get(void)
+{
+ uint32_t roll_num = 0;
+
+#ifdef MMI_PROJECT_Z5_DS_Z12_COMMON
+ srand(Hal_Timer_Get_Counter());
+ roll_num = 1 + rand() % 25;
+#endif
+
+ return roll_num;
+}
+
+
// heart sensor
unsigned char mmi_hsensor_measure_get_wear_status(void)
{
uint8_t mmi_gsensor_sensor_id_get(void);
+uint32_t mmi_sleep_roll_number_get(void);
+
/*hr_bp_bo*/
void mmi_hsensor_measure_value_clear(void);
#endif
#define NV_SECTION_UI_Not_Clear_DATA_LEN (sizeof(nv_watch_not_clean_data_t))
#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
-#define NV_SECTION_UI_REMIND_WAKE_UP_DATA_LEN (sizeof(nv_watch_remind_wake_up_t))
+#define NV_SECTION_UI_REMIND_WAKE_UP_DATA_LEN (sizeof(nv_watch_remind_item_t))
+#endif
+#ifdef __MMI_REMIND_SLEEP_SUPPORT__
+#define NV_SECTION_UI_REMIND_SLEEP_DATA_LEN (sizeof(nv_watch_remind_item_t))
+#endif
+#ifdef __MMI_REMIND_REST_SUPPORT__
+#define NV_SECTION_UI_REMIND_REST_DATA_LEN (sizeof(nv_watch_remind_rest_t))
+#endif
+#ifdef __MMI_REMIND_HOME_SUPPORT__
+#define NV_SECTION_UI_REMIND_HOME_DATA_LEN (sizeof(nv_watch_remind_home_t))
+#endif
+#ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+#define NV_SECTION_UI_REMIND_MEDICINE_DATA_LEN (sizeof(nv_watch_remind_medicine_t))
+#endif
+#ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+#define NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA_LEN (sizeof(nv_watch_remind_custom_medicine_t))
+#endif
+#ifdef __MMI_REMIND_DRINK_SUPPORT__
+#define NV_SECTION_UI_REMIND_DRINK_DATA_LEN (sizeof(nv_watch_remind_drink_t))
#endif
#ifdef __MMI_CUSTOM_HENG_AI__
#define NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE_LEN (sizeof(nv_watch_switch_t))
#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
#define NV_SECTION_UI_REMIND_WAKE_UP_DATA_FILE "ui_remind_wake_up_data.nv"
#endif
+#ifdef __MMI_REMIND_SLEEP_SUPPORT__
+#define NV_SECTION_UI_REMIND_SLEEP_DATA_FILE "ui_remind_sleep_data.nv"
+#endif
+#ifdef __MMI_REMIND_REST_SUPPORT__
+#define NV_SECTION_UI_REMIND_REST_DATA_FILE "ui_remind_rest_data.nv"
+#endif
+#ifdef __MMI_REMIND_HOME_SUPPORT__
+#define NV_SECTION_UI_REMIND_HOME_DATA_FILE "ui_remind_home_data.nv"
+#endif
+#ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+#define NV_SECTION_UI_REMIND_MEDICINE_DATA_FILE "ui_remind_medicine_data.nv"
+#endif
+#ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+#define NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA_FILE "ui_remind_custom_medicine_data.nv"
+#endif
+#ifdef __MMI_REMIND_DRINK_SUPPORT__
+#define NV_SECTION_UI_REMIND_DRINK_DATA_FILE "ui_remind_drink_data.nv"
+#endif
#ifdef __MMI_CUSTOM_HENG_AI__
#define NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE_FILE "ui_heng_ai_wake_ring_type.nv"
#define NV_SECTION_UI_HENG_AI_SLEEP_ACTIVATION_FILE "ui_heng_ai_sleep_activation.nv"
case NV_SECTION_UI_REMIND_WAKE_UP_DATA:
return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_WAKE_UP_DATA));
#endif
+ #ifdef __MMI_REMIND_SLEEP_SUPPORT__
+ case NV_SECTION_UI_REMIND_SLEEP_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_SLEEP_DATA));
+ #endif
+ #ifdef __MMI_REMIND_REST_SUPPORT__
+ case NV_SECTION_UI_REMIND_REST_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_REST_DATA));
+ #endif
+ #ifdef __MMI_REMIND_HOME_SUPPORT__
+ case NV_SECTION_UI_REMIND_HOME_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_HOME_DATA));
+ #endif
+ #ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_MEDICINE_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_MEDICINE_DATA));
+ #endif
+ #ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA));
+ #endif
+ #ifdef __MMI_REMIND_DRINK_SUPPORT__
+ case NV_SECTION_UI_REMIND_DRINK_DATA:
+ return (NV_SECTION_LEN(NV_SECTION_UI_REMIND_DRINK_DATA));
+ #endif
#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));
case NV_SECTION_UI_REMIND_WAKE_UP_DATA:
return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_WAKE_UP_DATA));
#endif
+ #ifdef __MMI_REMIND_SLEEP_SUPPORT__
+ case NV_SECTION_UI_REMIND_SLEEP_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_SLEEP_DATA));
+ #endif
+ #ifdef __MMI_REMIND_REST_SUPPORT__
+ case NV_SECTION_UI_REMIND_REST_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_REST_DATA));
+ #endif
+ #ifdef __MMI_REMIND_HOME_SUPPORT__
+ case NV_SECTION_UI_REMIND_HOME_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_HOME_DATA));
+ #endif
+ #ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_MEDICINE_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_MEDICINE_DATA));
+ #endif
+ #ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA));
+ #endif
+ #ifdef __MMI_REMIND_DRINK_SUPPORT__
+ case NV_SECTION_UI_REMIND_DRINK_DATA:
+ return (NV_SECTION_FILE_PATH(NV_SECTION_UI_REMIND_DRINK_DATA));
+ #endif
#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));
nv_watch_sim_iccid_t * sim_iccid_data;
#endif
nv_watch_not_clean_data_t * not_clean_data;
-#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
- nv_watch_remind_wake_up_t * remind_wake_up_data;
+#if defined(__MMI_REMIND_WAKE_UP_SUPPORT__) || defined(__MMI_REMIND_SLEEP_SUPPORT__)
+ nv_watch_remind_item_t * remind_item_data;
+#endif
+#ifdef __MMI_REMIND_REST_SUPPORT__
+ nv_watch_remind_rest_t * remind_rest_data;
+#endif
+#ifdef __MMI_REMIND_HOME_SUPPORT__
+ nv_watch_remind_home_t * remind_home_data;
+#endif
+#ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+ nv_watch_remind_medicine_t * remind_medicine_data;
+#endif
+#ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+ nv_watch_remind_custom_medicine_t * remind_custom_medicine_data;
+#endif
+#ifdef __MMI_REMIND_DRINK_SUPPORT__
+ nv_watch_remind_drink_t * remind_drink_data;
#endif
#ifdef __MMI_CUSTOM_HENG_AI__
nv_watch_heng_ai_sleep_activation_t * heng_ai_sleep_activation;
#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
case NV_SECTION_UI_REMIND_WAKE_UP_DATA:
- remind_wake_up_data = lv_mem_alloc(SectionLen);
- memset(remind_wake_up_data, 0x0, SectionLen);
- TempData = (char *)remind_wake_up_data;
+ remind_item_data = lv_mem_alloc(SectionLen);
+ memset(remind_item_data, 0x0, SectionLen);
+ TempData = (char *)remind_item_data;
break;
#endif
+ #ifdef __MMI_REMIND_SLEEP_SUPPORT__
+ case NV_SECTION_UI_REMIND_SLEEP_DATA:
+ remind_item_data = lv_mem_alloc(SectionLen);
+ memset(remind_item_data, 0x0, SectionLen);
+ TempData = (char *)remind_item_data;
+ break;
+ #endif
+ #ifdef __MMI_REMIND_REST_SUPPORT__
+ case NV_SECTION_UI_REMIND_REST_DATA:
+ remind_rest_data = lv_mem_alloc(SectionLen);
+ memset(remind_rest_data, 0x0, SectionLen);
+ TempData = (char *)remind_rest_data;
+ break;
+ #endif
+ #ifdef __MMI_REMIND_HOME_SUPPORT__
+ case NV_SECTION_UI_REMIND_HOME_DATA:
+ remind_home_data = lv_mem_alloc(SectionLen);
+ memset(remind_home_data, 0x0, SectionLen);
+ TempData = (char *)remind_home_data;
+ break;
+ #endif
+ #ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_MEDICINE_DATA:
+ remind_medicine_data = lv_mem_alloc(SectionLen);
+ memset(remind_medicine_data, 0x0, SectionLen);
+ TempData = (char *)remind_medicine_data;
+ break;
+ #endif
+ #ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+ case NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA:
+ remind_custom_medicine_data = lv_mem_alloc(SectionLen);
+ memset(remind_custom_medicine_data, 0x0, SectionLen);
+ TempData = (char *)remind_custom_medicine_data;
+ break;
+ #endif
+ #ifdef __MMI_REMIND_DRINK_SUPPORT__
+ case NV_SECTION_UI_REMIND_DRINK_DATA:
+ remind_drink_data = lv_mem_alloc(SectionLen);
+ memset(remind_drink_data, 0x0, SectionLen);
+ TempData = (char *)remind_drink_data;
+ break;
+ #endif
#ifdef __MMI_CUSTOM_HENG_AI__
case NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE:
nv_watch_alarm_info_t alarm_info[NV_ALARM_MAX_ALARM_NUM];
} __packed nv_watch_alarm_t;
-#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
-#define NV_REMIND_WAKE_UP_MAX_NUM (3)
-typedef struct
-{
- nv_watch_alarm_info_t remind_info[NV_REMIND_WAKE_UP_MAX_NUM];
-} __packed nv_watch_remind_wake_up_t;
-#endif
-
typedef struct
{
//uint8_t power_on_off_volume;
uint8_t white_list_switch;
uint8_t dial_pad_switch;
+ uint8_t low_battery_switch;
+ uint8_t fall_down_switch;
+ uint8_t take_off_switch;
#ifdef __MMI_PAGE_MAIN_MENU_TTS_SUPPORT__
uint8_t page_main_menu_tts;
#endif
} __packed nv_watch_sim_iccid_t;
#endif
+#if defined(__MMI_REMIND_WAKE_UP_SUPPORT__) || defined(__MMI_REMIND_SLEEP_SUPPORT__)
+#define NV_REMIND_ITEM_MAX_NUM (3)
+
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ uint8_t hour; // [0, 23]
+ uint8_t min; // [0, 59]
+ uint8_t repeat_bitmap; /* Bit 7: 0 means alarm once, 1 means repeat alarm */
+ /* Bit 0 ~ 6 are valid if bit 7 is 1 */
+ /* Bit 0: Sunday, bit 1: Monday ... bit 6: Saturday */
+} __packed nv_watch_remind_item_info_t;
+
+typedef struct
+{
+ nv_watch_remind_item_info_t remind_info[NV_REMIND_ITEM_MAX_NUM];
+} __packed nv_watch_remind_item_t;
+#endif
+
+#ifdef __MMI_REMIND_REST_SUPPORT__
+#define NV_REMIND_REST_MAX_NUM (2)
+
+typedef struct
+{
+ uint8_t hour_begin; // [0, 23]
+ uint8_t min_begin; // [0, 59]
+ uint8_t hour_end; // [0, 23]
+ uint8_t min_end; // [0, 59]
+} __packed nv_watch_remind_rest_info_t;
+
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ nv_watch_remind_rest_info_t remind_info[NV_REMIND_REST_MAX_NUM];
+} __packed nv_watch_remind_rest_t;
+#endif
+
+#ifdef __MMI_REMIND_HOME_SUPPORT__
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ uint8_t hour; // [0, 23]
+ uint8_t min; // [0, 59]
+} __packed nv_watch_remind_home_t;
+#endif
+
+#ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+#define NV_REMIND_MEDICINE_MAX_NUM (3)
+
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ uint8_t hour; // [0, 23]
+ uint8_t min; // [0, 59]
+} __packed nv_watch_remind_medicine_info_t;
+
+typedef struct
+{
+ nv_watch_remind_medicine_info_t remind_info[NV_REMIND_MEDICINE_MAX_NUM];
+} __packed nv_watch_remind_medicine_t;
+#endif
+
+#ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+#define NV_REMIND_CUSTOM_MEDICINE_MAX_NUM (3)
+
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ uint8_t hour; // [0, 23]
+ uint8_t min; // [0, 59]
+} __packed nv_watch_remind_custom_medicine_info_t;
+
+typedef struct
+{
+ nv_watch_remind_custom_medicine_info_t remind_info[NV_REMIND_CUSTOM_MEDICINE_MAX_NUM];
+ uint8_t repeat_bitmap; /* Bit 7: 0 means alarm once, 1 means repeat alarm */
+ /* Bit 0 ~ 6 are valid if bit 7 is 1 */
+ /* Bit 0: Sunday, bit 1: Monday ... bit 6: Saturday */
+} __packed nv_watch_remind_custom_medicine_t;
+#endif
+
+#ifdef __MMI_REMIND_DRINK_SUPPORT__
+typedef struct
+{
+ uint8_t is_valid; // 1: valid, 0: invalid
+ uint8_t hour_value;
+} __packed nv_watch_remind_drink_t;
+#endif
+
+
typedef struct
{
uint32_t hx3918_data[4]; // ::string
#endif
NV_SECTION_UI_Not_Clear_DATA, // nv_watch_not_clean_data_t
#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__
- NV_SECTION_UI_REMIND_WAKE_UP_DATA, // nv_watch_remind_wake_up_t
+ NV_SECTION_UI_REMIND_WAKE_UP_DATA, // nv_watch_remind_item_t
+#endif
+#ifdef __MMI_REMIND_SLEEP_SUPPORT__
+ NV_SECTION_UI_REMIND_SLEEP_DATA, // nv_watch_remind_item_t
+#endif
+#ifdef __MMI_REMIND_REST_SUPPORT__
+ NV_SECTION_UI_REMIND_REST_DATA, // nv_watch_remind_rest_t
+#endif
+#ifdef __MMI_REMIND_HOME_SUPPORT__
+ NV_SECTION_UI_REMIND_HOME_DATA, // nv_watch_remind_home_t
+#endif
+#ifdef __MMI_REMIND_MEDICINE_SUPPORT__
+ NV_SECTION_UI_REMIND_MEDICINE_DATA, // nv_watch_remind_medicine_t
+#endif
+#ifdef __MMI_REMIND_CUSTOM_MEDICINE_SUPPORT__
+ NV_SECTION_UI_REMIND_CUSTOM_MEDICINE_DATA, // nv_watch_remind_custom_medicine_t
+#endif
+#ifdef __MMI_REMIND_DRINK_SUPPORT__
+ NV_SECTION_UI_REMIND_DRINK_DATA, // nv_watch_remind_drink_t
#endif
#ifdef __MMI_CUSTOM_HENG_AI__
NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE, // nv_watch_switch_t