修复4G无法正常开启bug 2212/target/2 2213/1 2213/head
authorpenglei <1624952103@qq.com>
Mon, 8 Sep 2025 11:30:35 +0000 (19:30 +0800)
committerpenglei <1624952103@qq.com>
Mon, 8 Sep 2025 11:30:35 +0000 (19:30 +0800)
code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c

index 06a51b4..4973980 100644 (file)
@@ -245,21 +245,34 @@ bool cat1_api_is_cat1_enabled(void)
 
 uint32_t uapi_cat1_reset(uint32_t pwron)
 {
-    pin_t reset_pin = S_AGPIO_L28;
-#if defined(BOARD_LEINIAO)
-    reset_pin = S_AGPIO_L24;
-#endif
-
+//     pin_t reset_pin = S_AGPIO_L28;
+// #if defined(BOARD_LEINIAO)
+//     reset_pin = S_AGPIO_L24;
+// #endif
+
+//     if( pwron == 0)
+//     {
+//         uapi_gpio_set_dir(reset_pin, GPIO_DIRECTION_OUTPUT);
+//         uapi_gpio_set_val(reset_pin, GPIO_LEVEL_HIGH);
+//         printf("clear reset Cat1! L28 high \r\n");
+//     }else{
+//         uapi_gpio_set_dir(reset_pin, GPIO_DIRECTION_OUTPUT);
+//         uapi_gpio_set_val(reset_pin, GPIO_LEVEL_LOW); 
+//         printf("Reset Cat1! L28 low\r\n");
+//     }
+
+#if defined(BOARD_FD230)
     if( pwron == 0)
     {
-        uapi_gpio_set_dir(reset_pin, GPIO_DIRECTION_OUTPUT);
-        uapi_gpio_set_val(reset_pin, GPIO_LEVEL_HIGH);
+        uapi_gpio_set_dir(S_AGPIO_L28, GPIO_DIRECTION_OUTPUT);
+        uapi_gpio_set_val(S_AGPIO_L28, GPIO_LEVEL_HIGH);
         printf("clear reset Cat1! L28 high \r\n");
     }else{
-        uapi_gpio_set_dir(reset_pin, GPIO_DIRECTION_OUTPUT);
-        uapi_gpio_set_val(reset_pin, GPIO_LEVEL_LOW); 
+        uapi_gpio_set_dir(S_AGPIO_L28, GPIO_DIRECTION_OUTPUT);
+        uapi_gpio_set_val(S_AGPIO_L28, GPIO_LEVEL_LOW); 
         printf("Reset Cat1! L28 low\r\n");
     }
+#endif
 
     return 0;
 }
@@ -285,10 +298,12 @@ uint32_t uapi_cat1_power_on(uint32_t pwron)
 
 uint32_t uapi_cat1_bat_on(uint32_t pwron)
 {
+    pin_t bat_en_pin = 0;
 #if defined(BOARD_W9) || defined(BOARD_N9)
-    pin_t bat_en_pin =  S_AGPIO_L17;
+    bat_en_pin =  S_AGPIO_L17;
 #elif defined(BOARD_LEINIAO)
-    pin_t bat_en_pin =  S_AGPIO_L18;
+    bat_en_pin =  S_AGPIO_L18;
+#endif
     if( pwron == 0)
     {
         uapi_gpio_set_dir(bat_en_pin, GPIO_DIRECTION_OUTPUT);
@@ -299,7 +314,7 @@ uint32_t uapi_cat1_bat_on(uint32_t pwron)
         uapi_gpio_set_val(bat_en_pin, GPIO_LEVEL_HIGH);
         printf("BAT ON Cat1! %d high \r\n",bat_en_pin);
     }
-#endif
+
     
     return 0;
 }