Browse Source

屏蔽了USING PRINTF 可以使用EPAT,设置了PSM模式,更改了电压除以10

CHENJIE-PC\QiXiang_CHENJIE 4 years ago
parent
commit
7720ec5b5c
2 changed files with 19 additions and 2 deletions
  1. 0 2
      inc/hal_module_adapter.h
  2. 19 0
      src/app.c

+ 0 - 2
inc/hal_module_adapter.h

@@ -8,8 +8,6 @@ extern "C" {
 #include "sensor.h"
 #include "can.h"
 
-#define USING_PRINTF    								 (1)
-
 #define GPS_DATA_RECV_BUFFER_SIZE     						(1024)
 
 #define I2C_INT1_REQ_BITMAP    								 (0x1)

+ 19 - 0
src/app.c

@@ -917,6 +917,7 @@ uint8_t bcc_chk(uint8_t* data, uint8_t length)//发送bcc校验函数
 void Tcp_Batt_Data_Assemble(void)
 {
     int16_t Batt_current;
+    uint16_t BattU = 0x00;
     uint8_t csq=0;
     int8_t snr=0;
     int8_t rsnr=0;
@@ -956,6 +957,12 @@ void Tcp_Batt_Data_Assemble(void)
     }
     battbuffer[17] = Batt_current>>8;
     battbuffer[18] = Batt_current;
+    BattU = battbuffer[19]<<8|battbuffer[20];
+    BattU  = BattU/10;
+    battbuffer[19] = BattU>>8;
+    battbuffer[20] = BattU;
+    battbuffer[21] = BattU>>8;
+    battbuffer[22] = BattU;//外电压
     data_index = 32+Batt_Cell_Num_2+Batt_Temp_Num;
     battbuffer[data_index] = 0x00;//电池状态
     data_index++;
@@ -982,6 +989,15 @@ static void Tcp_Task(void* arg)
     uint8_t* TcpSendBuffer=NULL;
     volatile bool Tcp_Flag=false;
     eventCallbackMessage_t *queueItem = NULL;
+    uint8_t pmode;
+    uint32_t tau;
+    uint32_t act;
+    appSetEDRXSettingSync(0,5,0);
+    appSetPSMSettingSync(1,3*60*60,10);
+    appGetPSMSettingSync(&pmode,&tau,&act);
+    #ifdef USING_PRINTF
+        printf("psm:pmode-%d,tau-%d,act-%d!\n",pmode,tau,act);
+    #endif
     while(true)
     {
         switch(gProcess_Tcp_Task)
@@ -1042,6 +1058,9 @@ static void Tcp_Task(void* arg)
                 #ifdef USING_PRINTF
                         printf("TCP_STATE_WORK!\n");
                 #endif
+                #ifdef USING_PRINTF
+                    printf("psm:pmode-%d,tau-%d,act-%d!\n",pmode,tau,act);
+                #endif
                 Tcp_Flag = false;
                 TcpSendBuffer = (uint8_t *)malloc(NB_send_len);
                 while (!Tcp_Flag)