Bläddra i källkod

427 计算功率因素问题

liyi 10 månader sedan
förälder
incheckning
8c88847a8a
2 ändrade filer med 8 tillägg och 8 borttagningar
  1. 2 2
      f427/applications/power.c
  2. 6 6
      f427/applications/rtconfig.h

+ 2 - 2
f427/applications/power.c

@@ -12,7 +12,7 @@
 #include "time.h"
 #include "snmp.h"
 
-#define  SECOND_MIL   400
+#define  SECOND_MIL   200
 
 enum 
 {
@@ -522,7 +522,7 @@ static int total_proc(power_handle_t *h)
         h->ttl.total[k].power = tmp[k].power;
         h->ttl.total[k].freq = tmp[k].freq;
         h->ttl.total[k].consump = tmp[k].consump;
-				h->ttl.total[k].factor = ((tmp[k].power == 0) ? 0 : tmp[k].active/tmp[k].power);
+				h->ttl.total[k].factor = ((tmp[k].reactive == 0) ? 0 : tmp[k].power/tmp[k].reactive);
         h->ttl.total[k].active  = tmp[k].active;
         h->ttl.total[k].reactive = tmp[k].reactive;
     }

+ 6 - 6
f427/applications/rtconfig.h

@@ -188,7 +188,7 @@
 #define RT_LWIP_UDP
 #define RT_LWIP_TCP
 #define RT_LWIP_RAW
-#define RT_MEMP_NUM_NETCONN 14
+#define RT_MEMP_NUM_NETCONN 8
 
 //#define MEM_USE_POOLS       1
 //#define PBUF_POOL_SIZE   4
@@ -196,17 +196,17 @@
 //#define RT_LWIP_PBUF_POOL_BUFSIZE  512
 
 
-#define RT_LWIP_RAW_PCB_NUM 10
-#define RT_LWIP_UDP_PCB_NUM 10
-#define RT_LWIP_TCP_PCB_NUM 10
+#define RT_LWIP_RAW_PCB_NUM 8
+#define RT_LWIP_UDP_PCB_NUM 8
+#define RT_LWIP_TCP_PCB_NUM 8
 #define RT_LWIP_TCP_SEG_NUM 40
 #define RT_LWIP_TCP_SND_BUF 8196
 #define RT_LWIP_TCP_WND 8196
 #define RT_LWIP_TCPTHREAD_PRIORITY 10
 #define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
-#define RT_LWIP_TCPTHREAD_STACKSIZE 8192
+#define RT_LWIP_TCPTHREAD_STACKSIZE 4096
 #define RT_LWIP_ETHTHREAD_PRIORITY 12
-#define RT_LWIP_ETHTHREAD_STACKSIZE 8192
+#define RT_LWIP_ETHTHREAD_STACKSIZE 4096
 #define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
 #define RT_LWIP_REASSEMBLY_FRAG
 #define LWIP_NETIF_STATUS_CALLBACK 1