# cp project/$1/* sdk/ -r
# echo "cp project/$1/* sdk/ -r"
cd sdk
-# export PS_MODE=LTEGSM
-# make craneg_modem_watch PS_MODE=LTEGSM -j8
+
+
+build_time=$(date "+%Y%m%d_%H%M%S")
+echo $build_time
+
+read first_line < build_info.h
+echo $first_line
+
+echo $first_line > build_info.h
+echo >> build_info.h
+echo "#define MMI_BUILD_TIME \"$build_time\"" >> build_info.h
+
+
make craneg_modem_watch -j8
cd ..
\ No newline at end of file
/**********************
* GLOBAL FUNCTIONS
***********************/
+
+#ifdef __MMI_ZHSX_SUPPORT__
+void mmi_alarm_ring_click_stop(lv_obj_t * obj, lv_event_t e)
+{
+ if(LV_EVENT_CLICKED == e)
+ {
+ lv_alarm_obj_ext_t * ext = alarm_get_ext();
+ if(ext)
+ {
+ ext->timer_running = false;
+ ext->timer_id = NULL;
+ }
+
+ alarm_cleanup();
+ }
+}
+#endif
+
lv_obj_t * alarm_create(lv_obj_t * activity_obj)
{
/* activity obj */
lv_watch_obj_set_anim_mode(obj, LV_WATCH_ANIM_HOR_RIGHT_HIDE);
lv_alarm_obj_ext_t * ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_alarm_obj_ext_t));
+#ifdef __MMI_ZHSX_SUPPORT__
+ lv_obj_t * cont = lv_cont_create(obj, NULL);
+ lv_obj_set_size(cont, LV_HOR_RES, LV_VER_RES);
+ lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+ //lv_obj_set_style_local_bg_color(cont, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+ lv_obj_set_click(cont, true);
+ lv_obj_set_event_cb(cont, mmi_alarm_ring_click_stop);
+
+ lv_obj_t * cont_gif = lv_cont_create(cont, NULL);
+ lv_obj_set_size(cont_gif, 170, 170); // gif size
+ lv_obj_align(cont_gif, cont, LV_ALIGN_CENTER, 0, -30);
+
+ hal_rtc_t cur_time;
+ char time_str[8] = {0};
+
+ Hal_Rtc_Gettime(&cur_time);
+ sprintf(time_str, "%02d:%02d", cur_time.tm_hour, cur_time.tm_min);
+ lv_obj_t * label = lv_label_create(cont, NULL);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26);
+ lv_label_set_text(label, time_str);
+ lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
+ lv_obj_align(label, cont_gif, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
+
+ ext->gif_info = gif_open(cont_gif, ANIM_ALARM, 0);
+ //lv_obj_set_style_local_bg_color(ext->gif_info->container, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+ //lv_obj_add_style(ext->gif_info->container, LV_OBJ_PART_MAIN, &lv_style_transp_tight);
+ lv_obj_set_click(ext->gif_info->container, true);
+ lv_obj_set_event_cb(ext->gif_info->container, mmi_alarm_ring_click_stop);
+#else
/* gif open */
ext->gif_info = gif_open(obj, ANIM_ALARM, 0);
+#endif
if(!ext->gif_info) {
printf("open anim_alarm gif failed.\n");
return(NULL);
/* set recent alarm to rtc */
alarm_set_recent_to_rtc(alarms);
+#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ if(true == mmi_watch_is_in_do_not_disturb_time())
+ {
+ return;
+ }
+#endif
+
lv_obj_t * alarm_obj = lv_watch_get_activity_obj(ACT_ID_ALARM);
if(NULL != alarm_obj) {
return;
lv_obj_t * img_sending = lv_img_create(img_bkg, NULL);
lv_img_set_src(img_sending, ICON_WECHAT_SENDING_PROMPT3);
+#if USE_LV_WATCH_UI_240_320
+ lv_obj_align(img_sending, img_bkg, LV_ALIGN_IN_BOTTOM_MID, 0, -20);
+#elif USE_LV_WATCH_UI_240_280
+ lv_obj_align(img_sending, img_bkg, LV_ALIGN_IN_BOTTOM_MID, 0, -40);
+#else
lv_obj_align(img_sending, img_bkg, LV_ALIGN_IN_BOTTOM_MID, 0, -20);
+#endif
lv_anim_t * a = &(sending_ext->sending_anim);
lv_anim_init(a);
* DEFINES
*********************/
#ifdef __MMI_ZHSX_SUPPORT__
-#define QRCODE_BG_WIDTH (190+8)
+#define QRCODE_BG_WIDTH (190+12)
#define QRCODE_WIDTH (188)
#else
#define QRCODE_BG_WIDTH 136
static uint32_t s_watch_timed_location_time_stamp = 0, s_watch_timed_weather_time_stamp = 0;
static void * s_watch_heartbeat_action_timer_id = NULL;
static uint32_t s_watch_heartbeat_action_time_stamp = 0;
+static uint32_t s_watch_timed_location_last_steps = 0;
static void mmi_protocol_watch_timed_mission_timer_cb(uint32_t para);
static void mmi_protocol_watch_heartbeat_timer_cb(uint32_t para);
//location
if(mmi_protocol_watch_location_upload_interval_get() <= (cur_time_stamp - s_watch_timed_location_time_stamp))
{
- mmi_protocol_action_location();
+ uint32_t current_steps = asl_pedometer_steps_get();
+ if(20 <= MMI_ABS(current_steps - s_watch_timed_location_last_steps))
+ {
+ mmi_protocol_action_location();
+ }
s_watch_timed_location_time_stamp = cur_time_stamp;
+ s_watch_timed_location_last_steps = current_steps;
}
//weather
mmi_watch_location_mission_list_init();
mmi_protocol_action_location();
s_watch_timed_location_time_stamp = cur_time_stamp;
+ s_watch_timed_location_last_steps = asl_pedometer_steps_get();
mmi_protocol_action_get_weather();
s_watch_timed_weather_time_stamp = cur_time_stamp;
{
if(false == watch_modem_sim_present_check_req())
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no sim\n", __FUNCTION__, __LINE__);
+ return false;
+ }
+ if(MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no signal\n", __FUNCTION__, __LINE__);
return false;
}
if(false == mmi_watch_tcp_connect_state_get())
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: tcp not connect\n", __FUNCTION__, __LINE__);
return false;
}
if(false == mmi_protocol_watch_bind_state_get())
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: watch no bind\n", __FUNCTION__, __LINE__);
return false;
}