Browse Source

1.新增累计里程计算

LAPTOP-KB7QFH2U\ChenJie-PC 1 year ago
parent
commit
8470c4ea37

+ 3 - 3
FreeRTOS/Source/include/FreeRTOSConfig.h

@@ -29,7 +29,7 @@
 #ifndef FREERTOS_CONFIG_H
 #define FREERTOS_CONFIG_H
 //#define SEGGER_SYSTEMVIEW //选择SYSTEM查看
-#define SEGGER_RTT_PRINTF //选择RTT打印
+//#define SEGGER_RTT_PRINTF //选择RTT打印
 #ifdef SEGGER_SYSTEMVIEW
 	#include "SEGGER_SYSVIEW_FreeRTOS.h"
 #endif
@@ -111,7 +111,7 @@ PRIORITY THAN THIS! (higher priorities are lower numeric values. */
 #define configIDLE_TASK_STACK_DEPTH					512
 
 /* Tickless Idle Mode */
-#define configUSE_TICKLESS_IDLE                     0
+#define configUSE_TICKLESS_IDLE                     1
 
 /* QUEUE */
 #define configQUEUE_REGISTRY_SIZE                   2
@@ -154,7 +154,7 @@ PRIORITY THAN THIS! (higher priorities are lower numeric values. */
 
 /* The lowest interrupt priority that can be used in a call to a "set priority"
 function. */
-#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY  (0x01)
+#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY  (0x07)  //0x01->0x07
 
 /* Interrupt priorities used by the kernel port layer itself.  These are generic
 to all Cortex-M ports, and do not rely on any particular library functions. */

+ 1 - 0
code/app/AppGlobalVar.h

@@ -79,6 +79,7 @@ typedef struct _AppEppType
     uint32 battDischrgAccCap;
     uint32 battDischrgAccEnrg;
     uint16 battCycleTimes;
+    uint32 AccMileage;
 } AppEppBody;
 typedef struct _AppConfigType
 {

+ 13 - 13
code/app/AppTaskGps.c

@@ -118,20 +118,20 @@ void GpsDataDecode(uint8 *msg)
 				GpsInfoData.direction[0] = 0xff;
 				GpsInfoData.direction[1] = 0xff;
 			}
-//			if (speedtemp >= 30 && speedtemp <= 1500 && BattWorkStateDelay == 0x01)
-//			{
-//				AppDataInfo.appDataModify = true;
-//				AppDataInfo.AccMileage = speedtemp / 36 + AppDataInfo.AccMileage;
-//				if (AppDataInfo.AccMileage >= 0xfffffffe)
-//				{
-//					AppDataInfo.AccMileage = 0;
-//				}
-//			}累计里程的累加
+			if (speedtemp >= 50 && speedtemp <= 1500)
+			{
+				AppConfigInfo.appSaveFlg = true;
+				AppConfigInfo.AppDataInfo.AccMileage = speedtemp / 36 + AppConfigInfo.AppDataInfo.AccMileage;
+				if (AppConfigInfo.AppDataInfo.AccMileage >= 0xfffffffe)
+				{
+					AppConfigInfo.AppDataInfo.AccMileage = 0;
+				}
+			}//累计里程的累加
 		}
-//		GpsInfoData.AccMileage[0] = AppDataInfo.AccMileage >> 24;
-//		GpsInfoData.AccMileage[1] = AppDataInfo.AccMileage >> 16;
-//		GpsInfoData.AccMileage[2] = AppDataInfo.AccMileage >> 8;
-//		GpsInfoData.AccMileage[3] = AppDataInfo.AccMileage;
+		GpsInfoData.AccMileage[0] = AppConfigInfo.AppDataInfo.AccMileage >> 24;
+		GpsInfoData.AccMileage[1] = AppConfigInfo.AppDataInfo.AccMileage >> 16;
+		GpsInfoData.AccMileage[2] = AppConfigInfo.AppDataInfo.AccMileage >> 8;
+		GpsInfoData.AccMileage[3] = AppConfigInfo.AppDataInfo.AccMileage;
 	}
 	p2 = strtok(p2, ","); //只取第2行的信息GGA
 	memset(databuffer, 0x30, 20);

+ 0 - 1
code/app/AppTaskUart1.c

@@ -975,7 +975,6 @@ void TcpDataEncode(uint32 *PtrSendAddr, uint16 *SendLen)
 		*SendLen = BufferLen + sizeof(DebugMsgInfo);
 		SendBuffer = pvPortMalloc(*SendLen);
 		memcpy(SendBuffer + sizeof(DebugMsgInfo) - 1, rbuf, BufferLen);
-
 		DataLen = sizeof(DebugMsgInfo.DebugInfo) + BufferLen;
 		DebugMsgInfo.startSymbol[0] = TCP_START_SYM1;
 		DebugMsgInfo.startSymbol[1] = TCP_START_SYM2;

+ 1 - 1
generate/src/Clock_Ip_VS_0_PBcfg.c

@@ -498,7 +498,7 @@ const Clock_Ip_ClockConfigType Mcu_aClockConfigPB_VS_0[1U] = {
             #if CLOCK_DIVIDERS_NO > 1U
             {
                 SIRCDIV2_CLK,
-                1U,
+                2U,//zhengchao
                 {
                     0U,
                 }