gengxin
author@CHENG <2393524978@qq.com>
Sat, 25 May 2024 07:51:47 +0000 (15:51 +0800)
committer@CHENG <2393524978@qq.com>
Sat, 25 May 2024 07:51:47 +0000 (15:51 +0800)
2.sdk/sdk/gui/lv_watch/lv_apps/factory_mode/factory_mode_autotest.c

index 898abff..21cde42 100644 (file)
@@ -808,6 +808,13 @@ void autotest_gps_create(lv_obj_t * par)
     lv_label_set_text(label,str);
     fac_gps_mode_set(1);
 
+    lv_factory_obj_ext_t * ext_fac = factorymode_get_ext();
+    if(NULL != ext_fac)
+       {
+        ext_fac->module = AUTOTEST_GPS;
+        ext_fac->label_prompt = label;
+    }
+
     gps_core.force_on=0;
     gps_send_msg(GPS_MSG_STOP);
     gps_core.force_on=1;
@@ -1203,6 +1210,14 @@ void autotest_hal_stop(void)
     } else if(ext->module == AUTOTEST_VIBRATION) {
         Hal_Vibrator_Play_End();
     }
+       else if(ext->module == AUTOTEST_GPS)
+       {
+       #if USE_GPS
+               gps_core.force_on=0;
+               gps_send_msg(GPS_MSG_STOP);
+               fac_gps_mode_set(0);
+       #endif
+       }
     ext->module = AUTOTEST_MAX;
 
     if(TEST_AGING == ext->testmode) {
@@ -1294,6 +1309,14 @@ static void autotest_fail_btn_event_cb(lv_obj_t * btn, lv_event_t e)
         } else if(num == AUTOTEST_VIBRATION) {
             Hal_Vibrator_Play_End();
         }
+               else if(AUTOTEST_GPS == num)
+               {
+               #if USE_GPS
+                       gps_core.force_on=0;
+                       gps_send_msg(GPS_MSG_STOP);
+                       fac_gps_mode_set(0);
+               #endif
+               }
 
         if(ext->testmode == TEST_AUTO) {
             ext->test_res[num] = TEST_FAILED;
@@ -1338,6 +1361,14 @@ static void autotest_success_btn_event_cb(lv_obj_t * btn, lv_event_t e)
         } else if(num == AUTOTEST_VIBRATION) {
             Hal_Vibrator_Play_End();
         }
+               else if(AUTOTEST_GPS == num)
+               {
+               #if USE_GPS
+                       gps_core.force_on=0;
+                       gps_send_msg(GPS_MSG_STOP);
+                       fac_gps_mode_set(0);
+               #endif
+               }
 
         if(ext->testmode == TEST_AUTO) {
             ext->test_res[num] = TEST_SUCCESS;