gengxin
authorCCC <2393524978@qq.com>
Thu, 9 Nov 2023 02:43:33 +0000 (10:43 +0800)
committerCCC <2393524978@qq.com>
Thu, 9 Nov 2023 02:43:33 +0000 (10:43 +0800)
2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.c

index 5ab43c1..cb93bbb 100644 (file)
@@ -86,10 +86,7 @@ void mmi_watch_location_mission_list_data_send(void)
        
        if(true == _lv_ll_is_empty(&s_watch_location_mission_ll))
                return;
-       
-       s_watch_location_mission_ll_locked = 1;
-       MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll);
-       
+               
        LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
     LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %d,%d,%d,%d,%d,%d,%d,%d,%u\n", __LINE__,
                                        s_watch_location_data.gps_data.state,
@@ -102,10 +99,59 @@ void mmi_watch_location_mission_list_data_send(void)
                                        s_watch_location_data.gps_data.altitude * 10,
                                        s_watch_location_data.gps_data.satellite_num);
 
+#if 1
+
        // for debug
        uint8_t t_total = _lv_ll_get_len(&s_watch_location_mission_ll);
        uint8_t t_counter = 0;
        
+       s_watch_location_mission_ll_locked = 1;
+       MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_head(&s_watch_location_mission_ll);
+       
+       while((NULL != node) && (t_counter != t_total))
+       {
+               switch(* node)
+               {
+                       case MMI_WATCH_LOCATION_UD:
+                               LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+                               mmi_protocol_action_send_location(&s_watch_location_data);
+                               break;
+                               
+                       case MMI_WATCH_LOCATION_CRUD:
+                               LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+                               mmi_protocol_action_send_cur_location(&s_watch_location_data);
+                               break;
+                               
+                       case MMI_WATCH_LOCATION_WT:
+                               LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+                               mmi_protocol_action_send_get_weather(&s_watch_location_data);
+                               break;
+                               
+                       case MMI_WATCH_LOCATION_WARNING:
+                               LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+                               mmi_protocol_action_send_warning_info(&s_watch_location_data);
+                               break;
+                               
+                       default:
+                               break;
+               }
+
+               node = _lv_ll_get_next(&s_watch_location_mission_ll, node);
+               t_counter++;
+       }
+
+       LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,counter=%d\n", __FUNCTION__, __LINE__, t_total, t_counter);
+       _lv_ll_clear(&s_watch_location_mission_ll);
+
+#else
+
+       // for debug
+       uint8_t t_total = _lv_ll_get_len(&s_watch_location_mission_ll);
+       uint8_t t_counter = 0;
+       
+       s_watch_location_mission_ll_locked = 1;
+       MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll);
+       
        while(NULL != node)
        {
                switch(* node)
@@ -143,6 +189,7 @@ void mmi_watch_location_mission_list_data_send(void)
                t_counter++;
        }
        LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,counter=%d\n", __FUNCTION__, __LINE__, t_total, t_counter);
+#endif
 }
 
 void mmi_watch_location_gps_data_get(void)