Parcourir la source

1、解决新的带RGB接口表头与旧的不带RGB接口的表头GPIO冲突的问题。

liyuezong il y a 1 an
Parent
commit
0b3cc8840f
5 fichiers modifiés avec 10 ajouts et 6 suppressions
  1. 6 2
      pro/src/app.c
  2. 1 1
      pro/src/breaker_detection.c
  3. 1 1
      pro/src/hlw8110_handle.c
  4. 1 1
      pro/src/sensor_handle.c
  5. 1 1
      pro/src/switch_ctrl.c

+ 6 - 2
pro/src/app.c

@@ -1932,7 +1932,11 @@ static void* sensor_thread(void* arg)
                 if (_globalSensorMangerTemp->sensor_interface_type==2)//干节点传感器
                 {
                     int nStatus=0;
-                    g_switch_get_gpio_status(_globalSensorMangerTemp->sensor_addr+GPIO_PE14,&nStatus);
+#ifdef SCREEN_RGB
+                    g_switch_get_gpio_status(_globalSensorMangerTemp->sensor_addr + GPIO_PE14, &nStatus);
+#else
+                    g_switch_get_gpio_status(_globalSensorMangerTemp->sensor_addr + GPIO_PD11, &nStatus);
+#endif
                     _globalSensorInfo.val1=nStatus;
                     _globalSensorInfo.val2=-1;
                     if (nStatus == 0)
@@ -1948,7 +1952,7 @@ static void* sensor_thread(void* arg)
                 }                
             }
             break;
-    #endif
+#endif
 
             case SENSOR_TYPE_GAS: // 气体
             {

+ 1 - 1
pro/src/breaker_detection.c

@@ -72,7 +72,7 @@ int breaker_read_status(int gpio)
     // 打开GPIO值文件以读取  
     fd = open(value_path, O_RDONLY);  
     if (fd == -1) {  
-        perror("Failed to open GPIO value for reading");  
+        perror("Failed to open GPIO value for reading breaker");  
         return -1;  
     }  
   

+ 1 - 1
pro/src/hlw8110_handle.c

@@ -707,7 +707,7 @@ int hlw8110_read_Status(LowConf* conf,int* nStatus)
     // 打开GPIO值文件以读取  
     fd = open(value_path, O_RDONLY);  
     if (fd == -1) {  
-        perror("Failed to open GPIO value for reading");  
+        perror("Failed to open GPIO value for reading hlw8110");  
         return 1;  
     }  
   

+ 1 - 1
pro/src/sensor_handle.c

@@ -16,7 +16,7 @@ static int gpio_get(int gpio)
     // 打开GPIO值文件以读取  
     fd = open(value_path, O_RDONLY);  
     if (fd == -1) {  
-        perror("Failed to open GPIO value for reading");  
+        perror("Failed to open GPIO value for reading sensor");  
         return -1;  
     }  
   

+ 1 - 1
pro/src/switch_ctrl.c

@@ -2519,7 +2519,7 @@ int g_switch_get_gpio_status(int ngpio,int* nStatus)
     // 打开GPIO值文件以读取  
     fd = open(value_path, O_RDONLY);  
     if (fd == -1) {  
-        perror("Failed to open GPIO value for reading");  
+        perror("Failed to open GPIO value for reading switch");  
         return -1;  
     }