3 Commits 4cdfb5dc37 ... 7d6fdc1d5d

Auteur SHA1 Message Date
  lwy 7d6fdc1d5d 添加FIFO溢出错误上报 il y a 2 ans
  lwy e53b7e4936 添加FIFO溢出错误上报 il y a 2 ans
  liang 0a50682f4d 记步算法 重新设计 il y a 2 ans

+ 2 - 2
build_log.txt

@@ -1,6 +1,6 @@
 Build started: Project: ble_app_uart_c_pca10040_s132
-*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
+*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'E:\keil530\Keil_v5\ARM\ARMCC\Bin'
 Build target 'Shoes_FW_APP'
 FromELF: creating hex file...
 ÿþ".\_build\nrf52832_xxaa.axf" - 0 Error(s), 0 Warning(s).
-Build Time Elapsed:  00:00:02
+Build Time Elapsed:  00:00:05

BIN
dfu_readme/app_dfu_package.zip


+ 1 - 1
dfu_readme/自动生成升级固件.bat

@@ -15,7 +15,7 @@ echo=
 
 cd ..
 rem KEIL工具的安装目录
-set UV=C:\Keil_v5\UV4\UV4.exe
+set UV=E:\keil530\Keil_v5\UV4\UV4.exe
 rem 当前目录
 set Front_PRO_PATH=%cd%
 rem 工程目录

+ 1 - 1
drivers/drv_lsm6ds3tr_c.c

@@ -1863,7 +1863,7 @@ int	drv_lsm_get_fifo_group_num(void)
 		
 		lsm6ds3tr_c_fifo_mode_set(&ob_lsm6ds3tr_c.ctx, LSM6DS3TR_C_STREAM_MODE);
 		
-		return 0;
+		return -1;
 	}
 	
 	if(wt)

+ 8 - 0
hal/fml_imu.c

@@ -584,6 +584,8 @@ static int fml_imu_read_data_lsm(void)
 
 		fifo_group_num = fifo_group_num <= FML_IMU_DATA_GROUP_NUM_MAX ? fifo_group_num : FML_IMU_DATA_GROUP_NUM_MAX;
 		
+		if(fifo_group_num == FML_IMU_DATA_GROUP_NUM_MAX)Process_report_task_useTime(PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVER_NUM);
+		
 		if(fifo_group_num > 0)
 		{
 			for(i=0; i<fifo_group_num; i++)
@@ -624,6 +626,12 @@ static int fml_imu_read_data_lsm(void)
 				}
 			}
 		}
+		else if(fifo_group_num == -1)		//Òì³££¬fifoÒç³ö
+		{
+			Process_report_task_useTime(PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVERFLOW);
+
+			return 0;
+		}
 		else
 		{
 			return 0;

+ 84 - 111
motion/detect_step_by_mag.c

@@ -246,140 +246,113 @@ uint8_t RealTimeStep(int16_t front[3], int16_t back[3], int16_t acc[3])
 
 uint8_t detect_step_by_mag(int16_t *mag, int16_t acc_z)
 {
-	static uint8_t up_flag = 1;
-	int32_t mag_temp[3];
-	static int16_t accZ_buf[3];
-	static uint8_t acc_index = 0;
-	static int mag_buf[3];
-	static uint8_t mag_index = 0;
-	int step;
-	int calculate_flag = 0;
-  static int16_t LiftPoint;
-	static int16_t DropPoint;
-	static int16_t FrontTouchFlag=0;
-	static int16_t LiftDistance;
-	static int16_t counter1=0;
-	static int16_t counter2=0;
-	
-	
-	for(int i = 0; i < 3; i ++)
-	{
-		mag_temp[i] = (int32_t) (mag[i]);
-	}
-	mag_sqrt = abs(mag_temp[2]);
-	/*读入磁力计数据*/
-	if(mag_index >= 3)
-	{
-		mag_buf[0] = mag_buf[1];
-		mag_buf[1] = mag_buf[2];
-		mag_index = 2;
-		calculate_flag = 1;
-	}
-	mag_buf[mag_index++] = mag_sqrt;
+		//利用前脚磁力计以及后脚来判断
+
+	static int32_t  mag_front[5] = {40000};
+	static int16_t  acc_front_z[5];
+
+	static int32_t  mag_cur_min = 40000;
 	
-  /*读入xyZ轴加速度数据*/
-	if(acc_index >= 3)
-	{
-		accZ_buf[0] = accZ_buf[1];
-		accZ_buf[1] = accZ_buf[2];
-		acc_index = 2;
-	}
-	accZ_buf[acc_index++] = -acc_z;
+	static int time_count;
+
+	static int last_floor_status = 1;
 
+	static int press_up_wait_acc_time = 0;
+
+	int on_floor = 0;
 	
-	/*开始计算*/
-	if (calculate_flag == 1)
+	memcpy(mag_front, mag_front + 1, 4 * sizeof(int32_t));
+	memcpy(acc_front_z, acc_front_z + 1, 4 * sizeof(int16_t)); 
+
+	mag_front[4] = abs(mag[2]);
+	acc_front_z[4] = acc_z;
+
+
+	if (time_count > 4)
 	{
-		
-//		DEBUG_LOG("LiftPoint==:%d...\n",LiftPoint);
-//		DEBUG_LOG("DropPoint==:%d...\n",DropPoint);
-//		DEBUG_LOG("LiftDistance==:%d...\n",LiftDistance);
-						 
-		if(mag_buf[2] - mag_buf[1]>=0)
-	  {
-			if(FrontTouchFlag==0)
+		int16_t  max_acc_z = acc_front_z[0], min_acc_z = acc_front_z[0];
+		int32_t  max_mag_front = mag_front[0];
+		int32_t  min_mag_front = mag_front[0];
+		int16_t  max_mag_index = 0, min_mag_index = 0;
+
+		for (int i = 1; i < 5; i++)
+		{
+			if (min_mag_front > mag_front[i])
 			{
-       DropPoint = mag_buf[2];
+				min_mag_front = mag_front[i];
+				min_mag_index = i;
 			}
-			else
+
+			if (max_mag_front < mag_front[i])
 			{
-				if(mag_buf[2]>DropPoint)
-				{
-					DropPoint = mag_buf[2];
-				}
+				max_mag_front = mag_front[i];
+				max_mag_index = i;
 			}
- 	  }
-    else
-    {
-			if(FrontTouchFlag==0)
+
+			if (max_acc_z < acc_front_z[i])
 			{
-       LiftPoint = mag_buf[2];
+				max_acc_z = acc_front_z[i];
 			}
-			else
+
+			if (min_acc_z > acc_front_z[i])
 			{
-				;
+				min_acc_z = acc_front_z[i];
 			}
-	  }
-		
-		/*判断前后脚掌的状态*/
-    if(mag_buf[2] - LiftPoint>800)
-	  {
-		  FrontTouchFlag = 1;
-			if(mag_buf[2] - LiftPoint>LiftDistance)
-			{
-			  LiftDistance = mag_buf[2] - LiftPoint;
-			}			
-	  }
-	  if((mag_buf[2] - LiftPoint<=800)||((DropPoint-mag_buf[2]>0.4*LiftDistance)&&(abs(mag_buf[2]-mag_buf[1])<400)))
-	  {
-		  FrontTouchFlag = 0;
-			LiftDistance = 800;
-	  }
 
-		/*计算步数*/
-	  if (up_flag == 0)
-	  {
-			 counter1=0;
-			 if(counter2<300)
-			 {
-				counter2++;
-			 }
-			 if((FrontTouchFlag==1)&&(counter2>=8))
-			 {
-				 step = 1;
-				 up_flag = 1;
-				 DEBUG_LOG("step==%d\n",step);
-			 }
-			 else
-			 {
-				 step = 0;
-				 up_flag = 0;
-			 }
+		}
+
+
+		//寻找上升沿
+		if (min_mag_index < max_mag_index && max_mag_front > min_mag_front + 100)
+		{
+			mag_cur_min = mag_cur_min > min_mag_front ? min_mag_front : mag_cur_min;
+		}
+		else if (min_mag_index > max_mag_index && max_mag_front > min_mag_front + 100)
+		{
+			mag_cur_min = 40000;
+		}
+
+		if (mag_front[4] > mag_cur_min + 1000)
+		{
+			on_floor = 1;
+		}
+
+
+		if (last_floor_status == 1 && abs(acc_front_z[4] - acc_front_z[3]) < 105)
+		{
+			on_floor = 1;
+		}
+
+
+		if (on_floor)
+		{
+			press_up_wait_acc_time = 3; //拖延3个触地状态
+		}
+		else if (press_up_wait_acc_time > 0)
+		{
+			on_floor = 1;
+		}
 		
-	  }
-		else
+		if (press_up_wait_acc_time > 0)
 		{
-			step = 0;
-			counter2=0;
-			if(counter1<300)
-			{
-			  counter1++;
-			}
-			if((FrontTouchFlag==0)&&((abs(accZ_buf[0]-2000)>300)||(abs(accZ_buf[1]-2000)>300)||(abs(accZ_buf[2]-2000)>300))&&(counter1>=6))
-			{
-				up_flag=0;
-			}	
+			press_up_wait_acc_time--;
 		}
 
+		
 	}
 	else
 	{
-		step = 0;
-		LiftPoint = mag_buf[2];
-		DropPoint = mag_buf[2];
+		time_count++;
 	}
 	
+	uint8_t step = 0;
+	
+	if(last_floor_status == 0 && on_floor == 1)
+	{
+		step = 1;
+	}
 	
+	last_floor_status = on_floor;
 
 	return step;
 }

+ 15 - 15
pca10040/s132/arm5_no_packs/_build/arm_startup_nrf52.lst

@@ -531,21 +531,21 @@ ntf -I..\..\..\..\..\..\external\segger_rtt -I..\..\..\..\..\..\external\utf_co
 nverter -I..\..\..\..\..\..\integration\nrfx -I..\..\..\..\..\..\integration\nr
 fx\legacy -I..\..\..\..\..\..\modules\nrfx -I..\..\..\..\..\..\modules\nrfx\dri
 vers\include -I..\..\..\..\..\..\modules\nrfx\hal -I..\config -I.\RTE\_Shoes_FW
-_APP -IC:\Users\Administrator\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Cor
-e\Include -IC:\Users\Administrator\AppData\Local\Arm\Packs\NordicSemiconductor\
-nRF_DeviceFamilyPack\8.32.1\Device\Include --predefine="__MICROLIB SETA 1" --pr
-edefine="__UVISION_VERSION SETA 530" --predefine="_RTE_ SETA 1" --predefine="NR
-F52832_XXAA SETA 1" --predefine="_RTE_ SETA 1" --predefine="APP_TIMER_V2 SETA 1
-" --predefine="APP_TIMER_V2_RTC1_ENABLED SETA 1" --predefine="BOARD_PCA10040 SE
-TA 1" --predefine="CONFIG_GPIO_AS_PINRESET SETA 1" --predefine="FLOAT_ABI_HARD 
-SETA 1" --predefine="NRF52 SETA 1" --predefine="NRF52832_XXAA SETA 1" --predefi
-ne="NRF52_PAN_74 SETA 1" --predefine="NRF_SD_BLE_API_VERSION SETA 7" --predefin
-e="S132 SETA 1" --predefine="SOFTDEVICE_PRESENT SETA 1" --predefine="__HEAP_SIZ
-E SETA 8192" --predefine="__STACK_SIZE SETA 8192" --cpreproc_opts=-DAPP_TIMER_V
-2,-DAPP_TIMER_V2_RTC1_ENABLED,-DBOARD_PCA10040,-DCONFIG_GPIO_AS_PINRESET,-DFLOA
-T_ABI_HARD,-DNRF52,-DNRF52832_XXAA,-DNRF52_PAN_74,-DNRF_SD_BLE_API_VERSION=7,-D
-S132,-DSOFTDEVICE_PRESENT,-D__HEAP_SIZE=8192,-D__STACK_SIZE=8192 --list=.\_buil
-d\arm_startup_nrf52.lst RTE\Device\nRF52832_xxAA\arm_startup_nrf52.s
+_APP -IE:\keil530\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include -IE:\keil530\Arm
+\Packs\NordicSemiconductor\nRF_DeviceFamilyPack\8.32.1\Device\Include --predefi
+ne="__MICROLIB SETA 1" --predefine="__UVISION_VERSION SETA 530" --predefine="_R
+TE_ SETA 1" --predefine="NRF52832_XXAA SETA 1" --predefine="_RTE_ SETA 1" --pre
+define="APP_TIMER_V2 SETA 1" --predefine="APP_TIMER_V2_RTC1_ENABLED SETA 1" --p
+redefine="BOARD_PCA10040 SETA 1" --predefine="CONFIG_GPIO_AS_PINRESET SETA 1" -
+-predefine="FLOAT_ABI_HARD SETA 1" --predefine="NRF52 SETA 1" --predefine="NRF5
+2832_XXAA SETA 1" --predefine="NRF52_PAN_74 SETA 1" --predefine="NRF_SD_BLE_API
+_VERSION SETA 7" --predefine="S132 SETA 1" --predefine="SOFTDEVICE_PRESENT SETA
+ 1" --predefine="__HEAP_SIZE SETA 8192" --predefine="__STACK_SIZE SETA 8192" --
+cpreproc_opts=-DAPP_TIMER_V2,-DAPP_TIMER_V2_RTC1_ENABLED,-DBOARD_PCA10040,-DCON
+FIG_GPIO_AS_PINRESET,-DFLOAT_ABI_HARD,-DNRF52,-DNRF52832_XXAA,-DNRF52_PAN_74,-D
+NRF_SD_BLE_API_VERSION=7,-DS132,-DSOFTDEVICE_PRESENT,-D__HEAP_SIZE=8192,-D__STA
+CK_SIZE=8192 --list=.\_build\arm_startup_nrf52.lst RTE\Device\nRF52832_xxAA\arm
+_startup_nrf52.s
 
 
 

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
pca10040/s132/arm5_no_packs/_build/ble_app_uart_c_pca10040_s132_Shoes_FW_APP.dep


BIN
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.axf


+ 9 - 9
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.build_log.htm

@@ -5,11 +5,11 @@
 <h2>Tool Versions:</h2>
 IDE-Version: ¦ÌVision V5.30.0.0
 Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
-License Information: Ou Administrator, 11, LIC=EXJT4-FD1MZ-JJG6S-L29G4-S14VJ-CPP65
+License Information: lxy Administrator, 11, LIC=76F5U-S1WWA-DY9V3-A71WD-QJ6CF-HP6IP
  
 Tool Versions:
 Toolchain:       MDK-ARM Plus  Version: 5.30.0.0
-Toolchain Path:  C:\Keil_v5\ARM\ARMCC\Bin
+Toolchain Path:  E:\keil530\Keil_v5\ARM\ARMCC\Bin
 C Compiler:      Armcc.exe V5.06 update 6 (build 750)
 Assembler:       Armasm.exe V5.06 update 6 (build 750)
 Linker/Locator:  ArmLink.exe V5.06 update 6 (build 750)
@@ -21,11 +21,11 @@ Target DLL:      Segger\JL2CM3.dll V2.99.38.0
 Dialog DLL:      TCM.DLL V1.42.0.0
  
 <h2>Project:</h2>
-D:\Git_Project\shoes\smart_shoes\nRF5_SDK_17.0.0_9d13099\examples\Shoes1.3\shoe_mcu\pca10040\s132\arm5_no_packs\ble_app_uart_c_pca10040_s132.uvprojx
-Project File Date:  07/18/2022
+F:\exampleProject\test_sleep2\git\examples\long\shoe_mcu\pca10040\s132\arm5_no_packs\ble_app_uart_c_pca10040_s132.uvprojx
+Project File Date:  07/27/2022
 
 <h2>Output:</h2>
-*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
+*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'E:\keil530\Keil_v5\ARM\ARMCC\Bin'
 Build target 'Shoes_FW_APP'
 FromELF: creating hex file...
 ".\_build\nrf52832_xxaa.axf" - 0 Error(s), 0 Warning(s).
@@ -46,19 +46,19 @@ Package Vendor: NordicSemiconductor
 
 <h2>Collection of Component include folders:</h2>
   .\RTE\_Shoes_FW_APP
-  C:\Users\Administrator\AppData\Local\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include
-  C:\Users\Administrator\AppData\Local\Arm\Packs\NordicSemiconductor\nRF_DeviceFamilyPack\8.32.1\Device\Include
+  E:\keil530\Arm\Packs\ARM\CMSIS\5.6.0\CMSIS\Core\Include
+  E:\keil530\Arm\Packs\NordicSemiconductor\nRF_DeviceFamilyPack\8.32.1\Device\Include
 
 <h2>Collection of Component Files used:</h2>
 
    * Component: ARM::CMSIS:CORE:5.3.0
 
    * Component: NordicSemiconductor::Device:Startup:8.32.1
-      Source file:   Device\Source\arm\arm_startup_nrf52.s
       Source file:   Device\Source\system_nrf52.c
       Include file:  Device\Include\system_nrf.h
+      Source file:   Device\Source\arm\arm_startup_nrf52.s
       Include file:  Device\Include\system_nrf52.h
-Build Time Elapsed:  00:00:02
+Build Time Elapsed:  00:00:05
 </pre>
 </body>
 </html>

Fichier diff supprimé car celui-ci est trop grand
+ 298 - 298
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.hex


Fichier diff supprimé car celui-ci est trop grand
+ 183 - 167
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.htm


Fichier diff supprimé car celui-ci est trop grand
+ 6 - 7
pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvguix.Administrator


+ 4 - 4
pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvprojx

@@ -6144,8 +6144,8 @@
     <files>
       <file attr="config" category="source" condition="ARM Compiler" name="Device\Source\arm\arm_startup_nrf52.s" version="8.32.1">
         <instance index="0">RTE\Device\nRF52832_xxAA\arm_startup_nrf52.s</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.32.1" condition="nRF52832 Device and CMSIS"/>
-        <package license="License/license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.32.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.35.0" condition="nRF52832 Device and CMSIS"/>
+        <package license="License/license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.35.0"/>
         <targetInfos>
           <targetInfo name="Shoes_FW_APP"/>
           <targetInfo excluded="1" name="flash_s132_nrf52_7.0.1_softdevice"/>
@@ -6153,8 +6153,8 @@
       </file>
       <file attr="config" category="source" name="Device\Source\system_nrf52.c" version="8.32.1">
         <instance index="0">RTE\Device\nRF52832_xxAA\system_nrf52.c</instance>
-        <component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.32.1" condition="nRF52832 Device and CMSIS"/>
-        <package license="License/license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.32.1"/>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="NordicSemiconductor" Cversion="8.35.0" condition="nRF52832 Device and CMSIS"/>
+        <package license="License/license.txt" name="nRF_DeviceFamilyPack" schemaVersion="1.3" url="http://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/" vendor="NordicSemiconductor" version="8.35.0"/>
         <targetInfos>
           <targetInfo name="Shoes_FW_APP"/>
           <targetInfo excluded="1" name="flash_s132_nrf52_7.0.1_softdevice"/>

+ 72 - 0
system/system.c

@@ -5,6 +5,17 @@
 #include "hal_wearshoes.h"
 
 
+typedef struct _Task_UseTime
+{
+	uint32_t task_id;
+	uint32_t task_us;
+	uint32_t total_us;
+} Task_UseTime_t;
+
+static int _report_task_useTime_code = 0;
+static bool is_report_task_useTime = false;
+static Task_UseTime_t last_round_task_max_useTime = {0xFFFFFFFF,0,0},cur_round_task_max_useTime = {0xFFFFFFFF,0,0},all_round_task_max_useTime = {0xFFFFFFFF,0,0};
+
 //系统函数
 void FPS_process(void)
 {
@@ -159,6 +170,12 @@ int Process_App(void)
 {
 	int ret = 0;
 	uint8_t i = 0;
+	char buf[256];
+	uint32_t task_useTime = 0;
+	
+	cur_round_task_max_useTime.task_id 	= 0xFFFFFFFF;
+	cur_round_task_max_useTime.task_us 	= 0;
+	cur_round_task_max_useTime.total_us = 0;
 
 	for(i=0;i<process_dex;i++){
 		Except_Get_Cur_Porcess_ID(i);
@@ -167,11 +184,31 @@ int Process_App(void)
 			#if ProcessTime_EN
 			uint32_t useTime = NRF_RTC0->COUNTER;
 			#endif
+			
+			
+			uint32_t cnt1 = NRF_RTC0->COUNTER;
+			
 			if(mProcess[i].Peroid ==0) mProcess[i].cb();
 			else if(TIME_GetTicks()-mProcess[i].tim >= mProcess[i].Peroid ){
 				mProcess[i].tim = TIME_GetTicks();
 				mProcess[i].cb();
 			}
+			
+			uint32_t cnt2 = NRF_RTC0->COUNTER;
+			
+			if(cnt2<cnt1) cnt2 += 16777216;
+			
+			task_useTime = (cnt2-cnt1)/32.768 * 1000;
+			
+			cur_round_task_max_useTime.total_us += task_useTime;
+			
+			if(task_useTime > cur_round_task_max_useTime.task_us)
+			{
+				cur_round_task_max_useTime.task_us = task_useTime;
+				cur_round_task_max_useTime.task_id = i;
+			}
+			
+			
 			#if ProcessTime_EN
 			if(NRF_RTC0->COUNTER<useTime) useTime = (NRF_RTC0->COUNTER+16777216-useTime);
 			else useTime = (NRF_RTC0->COUNTER-useTime);
@@ -180,6 +217,34 @@ int Process_App(void)
 			#endif
 		}	
 	}
+	
+	if(cur_round_task_max_useTime.task_us > all_round_task_max_useTime.task_us)
+	{
+		all_round_task_max_useTime.task_us = cur_round_task_max_useTime.task_us;
+		all_round_task_max_useTime.task_id = cur_round_task_max_useTime.task_id;
+	}
+	
+	if(is_report_task_useTime)
+	{
+		sprintf(buf,"code:%d,report useTime:%d,%d,%d,%d,%d,%d,%d,%d\r\n",_report_task_useTime_code, \
+		                                                   last_round_task_max_useTime.task_id, \
+																											 last_round_task_max_useTime.task_us, \
+																											 last_round_task_max_useTime.total_us, \
+																											 cur_round_task_max_useTime.task_id, \
+																											 cur_round_task_max_useTime.task_us, \
+		                                                   cur_round_task_max_useTime.total_us, \
+		                                                   all_round_task_max_useTime.task_id, \
+		                                                   all_round_task_max_useTime.task_us);
+		Except_TxError(EXCEPT_EXCEPTION,buf);
+		
+		is_report_task_useTime = false;
+	}
+	
+	last_round_task_max_useTime.task_us 	= cur_round_task_max_useTime.task_us;
+	last_round_task_max_useTime.total_us 	= cur_round_task_max_useTime.total_us;
+	last_round_task_max_useTime.task_id 	= cur_round_task_max_useTime.task_id;
+	
+	
 	for(i=0;i<process_dex;i++){
 		if(mProcess[i].holdon){
 			ret = 1;	//不能进入低功耗
@@ -216,6 +281,13 @@ int Process_App(void)
 	return ret;
 }
 
+//触发上报上一轮、当前轮、所有轮任务中最大的耗时任务和ID,因为实时性的原因,所以不作保证性发送。
+void Process_report_task_useTime(int report_task_useTime_code)
+{
+	_report_task_useTime_code = report_task_useTime_code;
+	is_report_task_useTime = true;
+}
+
 //大循环
 void USR_Process(void)
 {

+ 4 - 0
system/system.h

@@ -7,6 +7,9 @@
 #include "SEGGER_RTT.h"
 #include "usr_config.h"
 
+#define		PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVER_NUM				1
+#define		PROCESS_REPORT_TASK_USETIME_IMU_FIFO_OVERFLOW				2
+
 typedef void (*Sleep_cb)(uint32_t);
 typedef void (*PROCESS_cb)(void);
 typedef struct _PROCESS{	//进程结构体
@@ -36,5 +39,6 @@ void Process_SetHoldOn(PROCESS_cb cb,uint8_t holdon); //app
 void Process_UpdatePeroid(PROCESS_cb cb,uint16_t Peroid);
 uint16_t Process_GetPeroid(PROCESS_cb cb);
 
+void Process_report_task_useTime(int report_task_useTime_code);	//触发上报上一轮、当前轮、所有轮任务中最大的耗时任务和ID,因为实时性的原因,所以不作保证性发送。
 #endif
 

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff