Ouj_Junchao 2 vuotta sitten
vanhempi
commit
cdb5b076f5
32 muutettua tiedostoa jossa 3188 lisäystä ja 5172 poistoa
  1. 0 1
      app/app_charge/app_charge.c
  2. 1 2
      app/app_client.c
  3. 26 7
      app/app_connect_manage.c
  4. 1 1
      app/app_detectIsHost.c
  5. 0 1
      app/app_power/app_power.c
  6. 0 1
      app/app_self_checking.c
  7. 6 7
      central_and_peripheral_secure_bootloader/arm5_no_packs/secure_bootloader_ble_s132_pca10040.uvguix.Administrator
  8. BIN
      dfu_readme/app_dfu_package.zip
  9. 8 8
      dfu_readme/app_setting.hex
  10. 398 398
      dfu_readme/app_setting_sd_boot.hex
  11. 8 8
      dfu_readme/setting_sd_boot.hex
  12. 16 16
      drivers/drv_qma7981.c
  13. 0 285
      hal/hal_battery/hal_battery_NoPowerEnPin - 副本.c
  14. 27 3
      hal/hal_battery/hal_battery_NoPowerEnPin.c
  15. 0 285
      hal/hal_battery/hal_battery_NoPowerEnPin1222323.c
  16. 0 300
      hal/hal_battery/hal_battery_NoPowerEnPin_12456.c
  17. 2 2
      hal/hal_ble_common.h
  18. 2 3
      hal/hal_charge.c
  19. 5 5
      pca10040/s132/arm5_no_packs/_build/ble_app_uart_c_pca10040_s132_Shoes_FW_APP.dep
  20. BIN
      pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.axf
  21. 3 4
      pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.build_log.htm
  22. 398 398
      pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.hex
  23. 1936 2100
      pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.htm
  24. 0 24
      pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.lnp
  25. 8 9
      pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvguix.Administrator
  26. 147 415
      pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvoptx
  27. 169 858
      pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvprojx
  28. 10 23
      pca10040/s132/config/sdk_config.h
  29. 2 2
      system/system.h
  30. 0 1
      system/usr.c
  31. 8 3
      system/usr_config.h
  32. 7 2
      版本更新记录.txt

+ 0 - 1
app/app_charge/app_charge.c

@@ -9,7 +9,6 @@
 #include "app_flash.h"
 #include "hal_battery.h"
 #include "ble_comm.h"
-#include "hal_ble_uart0.h"
 #include "hal_charge.h"
 
 /************************ º¯ÊýÉùÃ÷ ***********************************/

+ 1 - 2
app/app_client.c

@@ -65,7 +65,6 @@ void app_client_infomation_Send_defineName(uint8_t name[],uint8_t lenth)
 {
 	//<< 0(设备基本信息): 设备型号(64)+左鞋蓝牙地址(6)+硬件版本(2)+软件版本(2)+左鞋蓝牙地址(6)+硬件版本(6)+软件版本(2)
 	
-	uint32_t err_code;
 	uint8_t buf[128];
 	uint8_t L = SHOES_NAME_LEN+1;
 	
@@ -107,7 +106,7 @@ void app_client_infomation_Send_defineName(uint8_t name[],uint8_t lenth)
 void app_client_infomation_Send(void)
 {
 	//<< 0(设备基本信息): 设备型号(64)+左鞋蓝牙地址(6)+硬件版本(2)+软件版本(2)+左鞋蓝牙地址(6)+硬件版本(6)+软件版本(2)
-	uint32_t err_code;
+	
 	uint8_t buf[128];
 	uint8_t L = SHOES_NAME_LEN+1;
 	

+ 26 - 7
app/app_connect_manage.c

@@ -21,7 +21,7 @@
 /********************** º¯ÊýÉùÃ÷Çø *************************/
 extern uint8_t app_client_step_GetIsScan(void);
 
-BLE_Client_Tx_t mBLE_Client_T_CONNET_R = {
+BLE_Host_Tx_t mBLE_Host_T_CONNET_R = {
 	.n = 10,
 	.t = 500,
 	.cb = 0,
@@ -62,12 +62,12 @@ void app_connect_LED_Process(void)
 			    if(host_isconnect()){ 
 							if(0 == ResportCs_Flag){ResportCs_Flag = 1;		
 								host_state = app_conneted_getRight();
-								BLE_Client_Tx_Send(&mBLE_Client_T_CONNET_R,BLE_CONNET_R,&host_state,1);
+								BLE_Host_Tx_Send(&mBLE_Host_T_CONNET_R,BLE_CONNET_R,&host_state,1);
 								DEBUG_LOG("====================>BLE_Host_T_CONNET_LED:%d\n",TIME_GetTicks());
 							}
 					}
 					else if(ResportCs_Flag > 0)	{ResportCs_Flag = 0;
-						  BLE_Client_Tx_Clear(&mBLE_Client_T_CONNET_R);
+						  BLE_Host_Tx_Clear(&mBLE_Host_T_CONNET_R);
 					}
 					
 					if(0 != LedPlaytime){
@@ -81,7 +81,7 @@ void app_connect_LED_Process(void)
 						LedPlaytime =0;
 						Process_SetHoldOn(app_connect_LED_Process,0);
 						LED_Stop(LED_OVERTURN);
-						BLE_Client_Tx_Clear(&mBLE_Client_T_CONNET_R);
+						BLE_Host_Tx_Clear(&mBLE_Host_T_CONNET_R);
 					}
 			    break;
 		default:state =0;LedPlaytime =0;LED_Stop(LED_OVERTURN);break;
@@ -215,11 +215,27 @@ void app_connect_Process(void)
 		}
 }
 
-static void cb_BLE_BLE_CONNET_R(void* handle)
+static void cb_Client_BLE_CONNET_R(void* handle)
 {	
 	uint8_t host_state=BLE_RIGHT_DISCONNTED;
 	host_state =app_conneted_getRight();
-//	DEBUG_LOG("!!!!app_conneted_getRight:%d\n",host_state);
+  
+	if(mFlash.isHost){
+		if(BLE_RIGHT_CONNTED == host_state){
+			 BLE_Host_Tx_Send(0,BLE_CONNET_R,&host_state,1);
+		}
+		else BLE_Client_Tx_Send(0,BLE_CONNET_R,&host_state,1);
+	}
+	else {
+		host_state=BLE_RIGHT_CONNTED;
+		BLE_Client_Tx_Send(0,BLE_CONNET_R,&host_state,1);
+	}
+	
+}
+
+static void cb_Host_BLE_CONNET_R(void* handle)
+{	
+	uint8_t host_state=BLE_RIGHT_CONNTED;
 	BLE_Client_Tx_Send(0,BLE_CONNET_R,&host_state,1);
 }
 
@@ -229,7 +245,10 @@ void app_connect_manage_Init(void)
 	Ble_Slave_Connectd_Evt_Regist(cb_Slave_Connect);
 	Ble_Host_Connectd_Evt_Regist(cb_Host_Connect);
 	Process_Start(100,"app_connect_led",app_connect_LED_Process);
-	BLE_Client_Rx_Regist(BLE_CONNET_R,cb_BLE_BLE_CONNET_R);
+	BLE_Client_Rx_Regist(BLE_CONNET_R,cb_Client_BLE_CONNET_R);
+	
+	BLE_Host_Rx_Regist(BLE_CONNET_R,cb_Host_BLE_CONNET_R);
+	
 	BLE_Client_Rx_Regist(BLE_BLINK_LED,cb_BLE_BLINK_LED);
 }
 

+ 1 - 1
app/app_detectIsHost.c

@@ -146,7 +146,7 @@ static void app_detect_LR_Porcess(void)
 				if(runtime <15){runtime++;return;}
 				int16_t rol  = (int16_t)(getRoll());
 //				DEBUG_LOG("getRoll:%d\n",rol);
-				 if(rol >90 || rol < -160){//·´Ïò 		
+				 if(abs(rol) >90){//·´Ïò 		
 					 #if _SAME_DIRECTION
 								if(DETECT_LR_IS_RIGHT == direct_detect_LR)counter++;
 								else counter =0;

+ 0 - 1
app/app_power/app_power.c

@@ -14,7 +14,6 @@
 #include "system.h"
 #include "bsp_pwm.h"
 #include "app_client.h"
-#include "hal_ble_uart0.h"
 #include "hal_led.h"
 #include "lsm6ds3tr_c.h"
 #include "app_math.h"

+ 0 - 1
app/app_self_checking.c

@@ -6,7 +6,6 @@
 #include "app_self_checking.h"
 #include "hal_led.h"
 #include "hal_mt.h"
-#include "hal_ble_uart0.h"
 #include "hal_ble_client.h"
 #include "app_flash.h"
 #include "app_pair_chargerpin.h"

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6 - 7
central_and_peripheral_secure_bootloader/arm5_no_packs/secure_bootloader_ble_s132_pca10040.uvguix.Administrator


BIN
dfu_readme/app_dfu_package.zip


+ 8 - 8
dfu_readme/app_setting.hex

@@ -1,6 +1,6 @@
 :020000040007F3
-:10E00000EA9355A902000000010000000100000091
-:10E01000000000000000000014590200C28449B151
+:10E000009EE5C5BE02000000010000000100000006
+:10E01000000000000000000070290200A2E39EFB47
 :10E0200001000000000000000000000000000000EF
 :10E0300000000000000000000000000000000000E0
 :10E0400000000000000000000000000000000000D0
@@ -36,12 +36,12 @@
 :10E2200000000000000000000000000000000000EE
 :10E2300000000000000000000000000000000000DE
 :10E2400000000000000000000000000000000000CE
-:10E250000000000000000000000000007B185235A4
+:10E250000000000000000000000000008DB308FE78
 :10E2600000000000000000000000000000000000AE
 :10E27000000000000000000000000000000000009E
 :10E28000000000000000000000000000000000008E
 :10E29000000000000000000000000000000000007E
-:10E2A0000001C28449B1000000000000000000002D
+:10E2A0000001A2E39EFB000000000000000000004F
 :10E2B000000000000000000000000000000000005E
 :10E2C000000000000000000000000000000000004E
 :10E2D000000000000000000000000000000000003E
@@ -50,8 +50,8 @@
 :10E30000000000000000000000000000000000000D
 :10E3100000000000000000000000000000000000FD
 :04E32000000000FFFA
-:10F00000EA9355A902000000010000000100000081
-:10F01000000000000000000014590200C28449B141
+:10F000009EE5C5BE020000000100000001000000F6
+:10F01000000000000000000070290200A2E39EFB37
 :10F0200001000000000000000000000000000000DF
 :10F0300000000000000000000000000000000000D0
 :10F0400000000000000000000000000000000000C0
@@ -87,12 +87,12 @@
 :10F2200000000000000000000000000000000000DE
 :10F2300000000000000000000000000000000000CE
 :10F2400000000000000000000000000000000000BE
-:10F250000000000000000000000000007B18523594
+:10F250000000000000000000000000008DB308FE68
 :10F26000000000000000000000000000000000009E
 :10F27000000000000000000000000000000000008E
 :10F28000000000000000000000000000000000007E
 :10F29000000000000000000000000000000000006E
-:10F2A0000001C28449B1000000000000000000001D
+:10F2A0000001A2E39EFB000000000000000000003F
 :10F2B000000000000000000000000000000000004E
 :10F2C000000000000000000000000000000000003E
 :10F2D000000000000000000000000000000000002E

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 398 - 398
dfu_readme/app_setting_sd_boot.hex


+ 8 - 8
dfu_readme/setting_sd_boot.hex

@@ -11063,8 +11063,8 @@
 :10DF600000000000000000000000000000000000B1
 :10DF7000000000000090D00300000000000000003E
 :0CDF800085A6070000100000000008004B
-:10E00000EA9355A902000000010000000100000091
-:10E01000000000000000000014590200C28449B151
+:10E000009EE5C5BE02000000010000000100000006
+:10E01000000000000000000070290200A2E39EFB47
 :10E0200001000000000000000000000000000000EF
 :10E0300000000000000000000000000000000000E0
 :10E0400000000000000000000000000000000000D0
@@ -11100,12 +11100,12 @@
 :10E2200000000000000000000000000000000000EE
 :10E2300000000000000000000000000000000000DE
 :10E2400000000000000000000000000000000000CE
-:10E250000000000000000000000000007B185235A4
+:10E250000000000000000000000000008DB308FE78
 :10E2600000000000000000000000000000000000AE
 :10E27000000000000000000000000000000000009E
 :10E28000000000000000000000000000000000008E
 :10E29000000000000000000000000000000000007E
-:10E2A0000001C28449B1000000000000000000002D
+:10E2A0000001A2E39EFB000000000000000000004F
 :10E2B000000000000000000000000000000000005E
 :10E2C000000000000000000000000000000000004E
 :10E2D000000000000000000000000000000000003E
@@ -11114,8 +11114,8 @@
 :10E30000000000000000000000000000000000000D
 :10E3100000000000000000000000000000000000FD
 :04E32000000000FFFA
-:10F00000EA9355A902000000010000000100000081
-:10F01000000000000000000014590200C28449B141
+:10F000009EE5C5BE020000000100000001000000F6
+:10F01000000000000000000070290200A2E39EFB37
 :10F0200001000000000000000000000000000000DF
 :10F0300000000000000000000000000000000000D0
 :10F0400000000000000000000000000000000000C0
@@ -11151,12 +11151,12 @@
 :10F2200000000000000000000000000000000000DE
 :10F2300000000000000000000000000000000000CE
 :10F2400000000000000000000000000000000000BE
-:10F250000000000000000000000000007B18523594
+:10F250000000000000000000000000008DB308FE68
 :10F26000000000000000000000000000000000009E
 :10F27000000000000000000000000000000000008E
 :10F28000000000000000000000000000000000007E
 :10F29000000000000000000000000000000000006E
-:10F2A0000001C28449B1000000000000000000001D
+:10F2A0000001A2E39EFB000000000000000000003F
 :10F2B000000000000000000000000000000000004E
 :10F2C000000000000000000000000000000000003E
 :10F2D000000000000000000000000000000000002E

+ 16 - 16
drivers/drv_qma7981.c

@@ -314,22 +314,22 @@ static int get_bandwidth(uint8_t *p_bandwidth)
 	return 0;
 }
 
-static int set_interrupt_pin_1_type(bool open_drain, bool active_high)
-{
-	int 		ret;
-	uint8_t	data;
-	
-	ret = ob_qma7981.ctx.read_reg(0,0x20,&data,1);
-	if(ret == -1)return -1;
-	
-	set_bit(&data, 0, active_high);
-	set_bit(&data, 1, open_drain);
-	
-	ret = ob_qma7981.ctx.write_reg(0,0x20,&data,1);
-	if(ret == -1)return -1;
-	
-	return 0;
-}
+//static int set_interrupt_pin_1_type(bool open_drain, bool active_high)
+//{
+//	int 		ret;
+//	uint8_t	data;
+//	
+//	ret = ob_qma7981.ctx.read_reg(0,0x20,&data,1);
+//	if(ret == -1)return -1;
+//	
+//	set_bit(&data, 0, active_high);
+//	set_bit(&data, 1, open_drain);
+//	
+//	ret = ob_qma7981.ctx.write_reg(0,0x20,&data,1);
+//	if(ret == -1)return -1;
+//	
+//	return 0;
+//}
 
 static int set_full_scale_range(uint8_t	range)
 {

+ 0 - 285
hal/hal_battery/hal_battery_NoPowerEnPin - 副本.c

@@ -1,285 +0,0 @@
-/*********************************************************************
- * INCLUDES
- */
-#include "usr_config.h"
-#include "hal_battery.h"
-#include "cli.h"
-#define PRINTBLE 0
-
-int16_t ADC_GetValue(uint32_t channel)
-{
-	int16_t temp=0;
-	ADC_Read(channel, &temp);
-	return temp;
-}
-
-//返回5V信号,有5V的话返回1,没有的话返回0
-static char charge_in(void)
-{
-	uint32_t ch = nrf_gpio_pin_read(PIN_CHARGING);
-	if(ch)return 1;
-	else return 0;
-}
-
-
-static float filter(float value, float kg, float* preBestResult)
-{
-    float new_v = value;
-    new_v = *preBestResult * (1.0f - kg) + value * kg;
-    *preBestResult = new_v;
-    return new_v;
-}
-
-//负载测量仪
-//const float poo1o[]={5.10168165379740,5.34733044915476,5.61704724780813,5.91504952455148,6.24538762712249,6.61232594416931,7.01953712767654,7.46935265033756,7.96335122494516,8.50358200192486,9.09281468086492,9.73412484740972,10.4325753748233,11.1947240789575,12.0279998795062,12.9374916137117,13.9260172775225,14.9884510507725,16.1112400764950,17.2842706470249,18.5004202529463,19.7491314797588,21.0185653416731,22.2986943158191,23.5786963439054,24.8484876852771,26.0960349502041,27.3050010170951,28.4610454562188,29.5600116621742,30.6034682628590,31.5984702746944,32.5538106818571,33.4783670170583,34.3806559960012,35.2670128624846,36.1402606107567,36.9999854839693,37.8491813155179,38.6980882892879,39.5608382688438,40.4501589172903,41.3790038698800,42.3638365959298,43.4226235933126,44.5726867709324,45.8261573855592,47.1820084404052,48.6371187751347,50.1935842257010,51.8472994098979,53.5916193269800,55.4227167186607,57.3375320331711,59.3313953215555,61.3855139357523,63.4578870950691,65.4854598022728,67.4115262370806,69.2059495638218,70.8663781140949,72.4135268452713,73.8842849282509,75.3217897769173,76.7641290674375,78.2395953684845,79.7625546270391,81.3527328594521,83.0420141741465,84.8459239717299,86.7331023820235,88.6178189933847,90.3918821756187,91.9708771194967,93.3175662114905,94.4438984171043,95.3852594026215,96.1782551857171,96.8552759200241,97.4399007649065,97.9470337398631,98.3861216083791,98.7637272009236,99.0856995099079,99.3556936180377,99.5764952915733,99.7517164714185,99.8847888907893,99.9783503988427,100.038705667285,100.073274028685,100.088914482705,100.091844988568,100.087235862329,100.078726223926,100.068495717630,100.057471632431,100.046085695070,100.034540863310,100.022996031552,100.011610094200};
-
-//鞋子ADC
-static const float poo1o[] = {0, 0, 0.0279893723606430, 0.174605323652602, 0.325796538285416, 0.495164949358988, 0.661918800578876, 0.829024800123971, 1.00225498989324, 1.17936073685608, 1.37258677752597, 1.56525700069634, 1.78680072433224, 2.00361106262195, 2.24466616203811, 2.46699160701705, 2.77834696254638, 3.12186809827754, 3.58442625993982, 4.15025435558636, 4.75855743544068, 5.51189718744822, 6.35834306864975, 7.38461196888009, 8.48997478633724, 9.43096936165977, 10.3817319764220, 11.4116388420216, 12.3939372566211, 13.5048186806524, 14.5904959858255, 15.5237940825920, 16.4790857938893, 17.8137595522187, 18.9982251103467, 20.3392608271850, 21.5817542329461, 22.7218253119165, 23.9444316340532, 25.2939077624602, 26.6264082603126, 27.6802415218000, 29.0022881606974, 30.1783424265851, 31.1179209268523, 32.2887764986448, 33.3732790985050, 34.2380544358441, 35.2041112278740, 36.0163848326001, 36.8624779801428, 37.6634899287154, 38.5186413495501, 39.4878256764553, 40.2471232681709, 41.2081417271725, 42.3322924899204, 43.7047997876243, 44.9058976548061, 46.5044971286874, 47.8927266715832, 49.8558978793141, 51.9022338412845, 54.2586141300707, 56.3903798469888, 58.7696803719223, 60.8764981712366, 62.2358527791606, 63.8383633243999, 65.5021323737117, 67.1556090613014, 69.0159229136298, 70.1420773342446, 71.2282683025524, 72.4548338447843, 73.6556507850819, 74.8128040906371, 75.8695501837768, 77.1323517287879, 78.6365237973046, 80.3752005495001, 82.8468947240450, 86.6163997907370, 91.2910588313494, 93.9702969410882, 95.4930183746766, 96.9114001488224, 97.8493292727541, 98.7169169431273, 99.3270162091455, 99.6869018017068, 99.9917942993789, 99.9689500363163, 99.97, 99.98, 99.98, 99.98, 99.98, 99.99, 99.99, 99.99};
-static float interp1(float x)
-{
-    int absx = (int)x - 320;
-    float max = poo1o[absx + 1];
-    float min = poo1o[absx];
-    float temp = x - (float)absx - 320.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_Voltage2power = 0;
-static float Voltage2power(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_Voltage2power = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.01, &preBestResult_Voltage2power);
-    if (k < 320.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1(k);
-    }
-    return rev;
-}
-
-static const float chargeV2P[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0.606184684199367, 0.938307744774148, 1.30769659743727, 1.87378869014097, 2.39210582883903, 2.92471759425620, 3.79782257541779, 4.54241638183623, 5.09886597521223, 5.98930945903392, 6.49613916536905, 7.57967916311061, 8.42757721701290, 9.26589943580526, 10.3408809248851, 11.4278317273525, 12.3098089504989, 13.8095299712012, 15.4373756551577, 16.8805115746597, 18.4871688551768, 20.0578462608782, 21.6336381358003, 22.9916066660508, 24.4652374859292, 25.6565902258290, 26.8453581267414, 27.9070922567514, 28.9713295466563, 30.0209078713242, 30.9380166385130, 32.0419258329631, 33.1827748787620, 33.8691297160915, 34.8949274023278, 35.8840553861847, 36.9638277084030, 37.8687458690322, 38.9939274175310, 40.4336758333268, 41.1114865403869, 42.6160733592240, 44.2493873543177, 45.6026105469954, 47.4664557187522, 49.0734043728910, 51.2998758679562, 52.8880367841713, 54.7587352342972, 57.0178625862682, 58.8608281071146, 60.3657347075748, 62.4281274954232, 64.3086188700345, 65.8044424890286, 68.6475622104224, 72.7352289117192, 76.9893033499930, 84.0930819869950, 92.2923770276700, 96.3286261252036, 99.7542287364423};
-static float interp1_chargeV2P(float x)
-{
-    int absx = (int)x - 350;
-    float max = chargeV2P[absx + 1];
-    float min = chargeV2P[absx];
-    float temp = x - (float)absx - 350.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_chargeV2P_f = 0;
-static float chargeV2P_f(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_chargeV2P_f = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.05, &preBestResult_chargeV2P_f);
-    if (k < 350.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1_chargeV2P(k);
-    }
-    return rev;
-}
-
-//返回电量百分比
-static float Voltage2mah(float mah, float storage_capacity)
-{
-    return mah / storage_capacity * 100.0f;
-}
-//返回电压剩余绝对容量
-static float mah2Voltage(float P, float storage_capacity)
-{
-    return storage_capacity * P / 100.0f;
-}
-
-static void Charge(float mV, float* mAh, float interval_s)
-{
-    float A = mV / 3000.0f * 1.1f;
-    float dmAh = A * 1000.0f * interval_s / 3600.0f;
-    *mAh = *mAh + dmAh;
-}
-
-static float Power_management(float mV_Battery, float mV_Charge)
-{
-    static float P1 = 100;
-    static float P2 = 0;
-    float P_mAh = 0;
-    float storage_capacity = 350;
-    static float mAh = 0;
-    static char sta = 0;
-    static float kg = 0;
-    switch (sta)
-    {
-			case 0:
-				if (mV_Charge > 20)
-				{
-					sta = 2; //充电过程
-					P1=chargeV2P_f(mV_Battery);
-				}
-				else
-				{
-					P1 = Voltage2power(mV_Battery);
-					sta = 1; //放电过程
-				}
-				break;
-        case 1:
-            if (mV_Charge > 20)
-            {
-                sta = 2; //充电过程
-                kg = 0;
-							
-							//解决插上充电没接电池状态下突然接上电池时电量不衔接的问题
-							if((mV_Battery<4000)&&(P1>95.0f))
-							{
-								P1=chargeV2P_f(mV_Battery);
-							}
-														
-            }
-            else
-            {
-                //---------------------------------------------------
-                P2 = Voltage2power(mV_Battery);
-                if (P1 > P2) //过滤刚拔掉充电线时候的虚高
-                {
-                    P1 = P2;
-                }	
-								
-								//解决充满电后充电器不拔出来的情况显示不到100%的情况
-								if(charge_in()&&(P1>95.0f))
-								{
-									P1=100.0f;
-								}
-
-                //---------------------------------------------------
-                //---------------------------------------------------
-            }
-            break;
-        case 2:
-            if (mV_Charge < 20)
-            {
-                sta = 1; //放电过程
-								//初始化滤波器波器
-                preBestResult_Voltage2power = mV_Battery / 10;
-                if (P1 > 99.1f)
-                {
-                    P1 = 100.0f;
-                }
-								
-//								//解决大电流充电的时候突然把电池拔掉
-//								if(mV_Battery>4100)
-//								{
-//									P1=Voltage2power(mV_Battery);
-//								}
-								
-            }
-            else
-            {
-                //---------------------------------------------------
-                mAh = mah2Voltage(P1, storage_capacity);
-                Charge(mV_Charge, &mAh, 1);
-                P_mAh = Voltage2mah(mAh, storage_capacity);
-                P2 = chargeV2P_f(mV_Battery);
-                kg = mV_Charge / 1000.0f;
-                if (kg > 1.0f)
-                {
-                    kg = 1.0f;
-                }
-                P2 = (1.0f - kg) * P2 + kg * P_mAh;
-                if (P1 < P2) //过滤刚插上充电线时候的虚低
-                {
-                    P1 = P2;
-                }
-                if (P1 > 100)
-                {
-                    P1 = 99.9;
-                }
-                //---------------------------------------------------
-                //                 P2=chargeV2P_f(mV_Battery);
-                //                 if(P1<P2)//过滤刚插上充电线时候的虚低
-                //                     P1=P2;
-                //---------------------------------------------------
-            }
-            break;
-    }
-    return P1;
-}
-
-static float adc_tp4056_power = 0;
-
-static void hal_battery_Process(void)
-{
-		#if PRINTBLE
-    char buff[256];
-		unsigned char len = 0;
-	  #endif
-    int16_t adcVal;
-    int16_t CHARGMEASURE;
-    int16_t volTemp;
-    int16_t volTemp_CHARGMEASURE;
-    
-    adcVal = ADC_GetValue(PIN_ADC_BAT_CHANNEL);
-    volTemp = ADC_RESULT_IN_MILLI_VOLTS(adcVal) * 5 / 3; // 电池电压转换计算
-    CHARGMEASURE = ADC_GetValue(PIN_ADC_CHARGMEASURE_CHANNEL);
-    volTemp_CHARGMEASURE = ADC_RESULT_IN_MILLI_VOLTS(CHARGMEASURE);// 电池电压转换计算
-	
-    adc_tp4056_power = Power_management((float)volTemp, (float)volTemp_CHARGMEASURE);
-	  #if PRINTBLE
-    len = sprintf(buff, "%4d ,%4d ,%4d,%f\r\n",TIME_GetTicks(), volTemp, volTemp_CHARGMEASURE, adc_tp4056_power);
-    send_bytes_client((unsigned char*)buff, len);
-	  #endif
-//		cli_process(&clirtt);
-//	  uint8_t persent = 0;
-//	  persent = (uint8_t)(adc_tp4056_power+0.5f);
-//	  DEBUG_LOG("hal_battery_Process:%d,%d\n",persent,volTemp);
-}
-
-
-
-
-//返回的电量范围: 0~100 表示电量百分比
-uint8_t GetBatteryPersent(void)
-{
-	uint8_t persent = 0;
-	persent = (uint8_t)(adc_tp4056_power+0.5f);
-	if(persent > 100)persent =100;
-	return persent;
-}
-//void battydeb_pcs(cli_t *p_cli, unsigned short argc, char **argv)
-//{
-
-//		cli_printf(p_cli, "GetBatteryPersent %d",GetBatteryPersent());
-
-//}
-//CLI_CMD_REGISTER(battydeb, "Cli cmd history", battydeb_pcs);
-void hal_battery_init(void){
-	hal_battery_Process();
-	Process_Start(1000,"hal_battery_Process",hal_battery_Process);
-}
-

+ 27 - 3
hal/hal_battery/hal_battery_NoPowerEnPin.c

@@ -362,7 +362,11 @@ static float Power_management(float mV_Battery, float mV_Charge)
                 battercb->sta = 1; //放电过程
                 //初始化滤波器波器
                 battercb->preBestResult_Voltage2power = mV_Battery / 10;
-                if ((battercb->P1 > 99.1f)&&(charge_in()))
+							  #ifdef PIN_BATFULL
+                   if ((battercb->P1 > 99.1f)&&(charge_in())&&(nrf_gpio_pin_read(PIN_BATFULL)==0))
+							  #else 
+							     if ((battercb->P1 > 99.1f)&&(charge_in()))
+							  #endif
                 {
                     battercb->P1 = 100.0f;
                 }
@@ -410,6 +414,8 @@ int16_t hal_GetBatttery_Adc(void){
 
 static void hal_battery_Process(void)
 {
+	  static int count=0;
+	  static int adc_midal=0;
     static int cprign = 0;
     #if PRINTBLE
     char buff[256];
@@ -423,7 +429,22 @@ static void hal_battery_Process(void)
     volTemp = ADC_RESULT_IN_MILLI_VOLTS(adcVal) * 5 / 3; // 电池电压转换计算
     CHARGMEASURE = ADC_GetValue(PIN_ADC_CHARGMEASURE_CHANNEL);
     volTemp_CHARGMEASURE = ADC_RESULT_IN_MILLI_VOLTS(CHARGMEASURE);// 电池电压转换计算
-	
+	  
+	  if(count<10)
+		{
+			adc_midal+=volTemp;
+			DEBUG_LOG(0,"N %d  %5d battery %d mV\r\n",count,adc_midal,volTemp);
+			count++;
+			return ;
+		}
+		else if(count==10)
+		{
+			Process_UpdatePeroid(hal_battery_Process,1000);
+			volTemp=adc_midal/count;
+			DEBUG_LOG(0,"average battery %d mV  %d\r\n",volTemp,count);
+			count++;
+		}
+		
     battercb->adc_tp4056_power = Power_management((float)volTemp, (float)volTemp_CHARGMEASURE);
     #if PRINTBLE
     len = sprintf(buff, "%4d ,%4d ,%4d,%f\r\n", TIME_GetTicks(), volTemp, volTemp_CHARGMEASURE, battercb->adc_tp4056_power);
@@ -503,7 +524,10 @@ void hal_battery_init(void)
 {
 		cb_init();
     hal_battery_Process();
+	  #ifdef PIN_BATFULL
+	  nrf_gpio_cfg_input(PIN_BATFULL,NRF_GPIO_PIN_PULLUP);
+	  #endif
     BLE_Client_Rx_Regist(BLE_ERR, cb_BLE_Client_ERR);
-    Process_Start(1000, "hal_battery_Process", hal_battery_Process);
+    Process_Start(10, "hal_battery_Process", hal_battery_Process);
 }
 

+ 0 - 285
hal/hal_battery/hal_battery_NoPowerEnPin1222323.c

@@ -1,285 +0,0 @@
-/*********************************************************************
- * INCLUDES
- */
-#include "usr_config.h"
-#include "hal_battery.h"
-#include "cli.h"
-#define PRINTBLE 0
-
-int16_t ADC_GetValue(uint32_t channel)
-{
-	int16_t temp=0;
-	ADC_Read(channel, &temp);
-	return temp;
-}
-
-//返回5V信号,有5V的话返回1,没有的话返回0
-static char charge_in(void)
-{
-	uint32_t ch = nrf_gpio_pin_read(PIN_CHARGING);
-	if(ch)return 1;
-	else return 0;
-}
-
-
-static float filter(float value, float kg, float* preBestResult)
-{
-    float new_v = value;
-    new_v = *preBestResult * (1.0f - kg) + value * kg;
-    *preBestResult = new_v;
-    return new_v;
-}
-
-//负载测量仪
-//const float poo1o[]={5.10168165379740,5.34733044915476,5.61704724780813,5.91504952455148,6.24538762712249,6.61232594416931,7.01953712767654,7.46935265033756,7.96335122494516,8.50358200192486,9.09281468086492,9.73412484740972,10.4325753748233,11.1947240789575,12.0279998795062,12.9374916137117,13.9260172775225,14.9884510507725,16.1112400764950,17.2842706470249,18.5004202529463,19.7491314797588,21.0185653416731,22.2986943158191,23.5786963439054,24.8484876852771,26.0960349502041,27.3050010170951,28.4610454562188,29.5600116621742,30.6034682628590,31.5984702746944,32.5538106818571,33.4783670170583,34.3806559960012,35.2670128624846,36.1402606107567,36.9999854839693,37.8491813155179,38.6980882892879,39.5608382688438,40.4501589172903,41.3790038698800,42.3638365959298,43.4226235933126,44.5726867709324,45.8261573855592,47.1820084404052,48.6371187751347,50.1935842257010,51.8472994098979,53.5916193269800,55.4227167186607,57.3375320331711,59.3313953215555,61.3855139357523,63.4578870950691,65.4854598022728,67.4115262370806,69.2059495638218,70.8663781140949,72.4135268452713,73.8842849282509,75.3217897769173,76.7641290674375,78.2395953684845,79.7625546270391,81.3527328594521,83.0420141741465,84.8459239717299,86.7331023820235,88.6178189933847,90.3918821756187,91.9708771194967,93.3175662114905,94.4438984171043,95.3852594026215,96.1782551857171,96.8552759200241,97.4399007649065,97.9470337398631,98.3861216083791,98.7637272009236,99.0856995099079,99.3556936180377,99.5764952915733,99.7517164714185,99.8847888907893,99.9783503988427,100.038705667285,100.073274028685,100.088914482705,100.091844988568,100.087235862329,100.078726223926,100.068495717630,100.057471632431,100.046085695070,100.034540863310,100.022996031552,100.011610094200};
-
-//鞋子ADC
-static const float poo1o[] = {0, 0, 0.0279893723606430, 0.174605323652602, 0.325796538285416, 0.495164949358988, 0.661918800578876, 0.829024800123971, 1.00225498989324, 1.17936073685608, 1.37258677752597, 1.56525700069634, 1.78680072433224, 2.00361106262195, 2.24466616203811, 2.46699160701705, 2.77834696254638, 3.12186809827754, 3.58442625993982, 4.15025435558636, 4.75855743544068, 5.51189718744822, 6.35834306864975, 7.38461196888009, 8.48997478633724, 9.43096936165977, 10.3817319764220, 11.4116388420216, 12.3939372566211, 13.5048186806524, 14.5904959858255, 15.5237940825920, 16.4790857938893, 17.8137595522187, 18.9982251103467, 20.3392608271850, 21.5817542329461, 22.7218253119165, 23.9444316340532, 25.2939077624602, 26.6264082603126, 27.6802415218000, 29.0022881606974, 30.1783424265851, 31.1179209268523, 32.2887764986448, 33.3732790985050, 34.2380544358441, 35.2041112278740, 36.0163848326001, 36.8624779801428, 37.6634899287154, 38.5186413495501, 39.4878256764553, 40.2471232681709, 41.2081417271725, 42.3322924899204, 43.7047997876243, 44.9058976548061, 46.5044971286874, 47.8927266715832, 49.8558978793141, 51.9022338412845, 54.2586141300707, 56.3903798469888, 58.7696803719223, 60.8764981712366, 62.2358527791606, 63.8383633243999, 65.5021323737117, 67.1556090613014, 69.0159229136298, 70.1420773342446, 71.2282683025524, 72.4548338447843, 73.6556507850819, 74.8128040906371, 75.8695501837768, 77.1323517287879, 78.6365237973046, 80.3752005495001, 82.8468947240450, 86.6163997907370, 91.2910588313494, 93.9702969410882, 95.4930183746766, 96.9114001488224, 97.8493292727541, 98.7169169431273, 99.3270162091455, 99.6869018017068, 99.9917942993789, 99.9689500363163, 99.97, 99.98, 99.98, 99.98, 99.98, 99.99, 99.99, 99.99};
-static float interp1(float x)
-{
-    int absx = (int)x - 320;
-    float max = poo1o[absx + 1];
-    float min = poo1o[absx];
-    float temp = x - (float)absx - 320.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_Voltage2power = 0;
-static float Voltage2power(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_Voltage2power = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.01, &preBestResult_Voltage2power);
-    if (k < 320.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1(k);
-    }
-    return rev;
-}
-
-static const float chargeV2P[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0.606184684199367, 0.938307744774148, 1.30769659743727, 1.87378869014097, 2.39210582883903, 2.92471759425620, 3.79782257541779, 4.54241638183623, 5.09886597521223, 5.98930945903392, 6.49613916536905, 7.57967916311061, 8.42757721701290, 9.26589943580526, 10.3408809248851, 11.4278317273525, 12.3098089504989, 13.8095299712012, 15.4373756551577, 16.8805115746597, 18.4871688551768, 20.0578462608782, 21.6336381358003, 22.9916066660508, 24.4652374859292, 25.6565902258290, 26.8453581267414, 27.9070922567514, 28.9713295466563, 30.0209078713242, 30.9380166385130, 32.0419258329631, 33.1827748787620, 33.8691297160915, 34.8949274023278, 35.8840553861847, 36.9638277084030, 37.8687458690322, 38.9939274175310, 40.4336758333268, 41.1114865403869, 42.6160733592240, 44.2493873543177, 45.6026105469954, 47.4664557187522, 49.0734043728910, 51.2998758679562, 52.8880367841713, 54.7587352342972, 57.0178625862682, 58.8608281071146, 60.3657347075748, 62.4281274954232, 64.3086188700345, 65.8044424890286, 68.6475622104224, 72.7352289117192, 76.9893033499930, 84.0930819869950, 92.2923770276700, 96.3286261252036, 99.7542287364423};
-static float interp1_chargeV2P(float x)
-{
-    int absx = (int)x - 350;
-    float max = chargeV2P[absx + 1];
-    float min = chargeV2P[absx];
-    float temp = x - (float)absx - 350.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_chargeV2P_f = 0;
-static float chargeV2P_f(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_chargeV2P_f = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.05, &preBestResult_chargeV2P_f);
-    if (k < 350.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1_chargeV2P(k);
-    }
-    return rev;
-}
-
-//返回电量百分比
-static float Voltage2mah(float mah, float storage_capacity)
-{
-    return mah / storage_capacity * 100.0f;
-}
-//返回电压剩余绝对容量
-static float mah2Voltage(float P, float storage_capacity)
-{
-    return storage_capacity * P / 100.0f;
-}
-
-static void Charge(float mV, float* mAh, float interval_s)
-{
-    float A = mV / 3000.0f * 1.1f;
-    float dmAh = A * 1000.0f * interval_s / 3600.0f;
-    *mAh = *mAh + dmAh;
-}
-
-static float Power_management(float mV_Battery, float mV_Charge)
-{
-    static float P1 = 100;
-    static float P2 = 0;
-    float P_mAh = 0;
-    float storage_capacity = 350;
-    static float mAh = 0;
-    static char sta = 0;
-    static float kg = 0;
-    switch (sta)
-    {
-			case 0:
-				if (mV_Charge > 20)
-				{
-					sta = 2; //充电过程
-					P1=chargeV2P_f(mV_Battery);
-				}
-				else
-				{
-					P1 = Voltage2power(mV_Battery);
-					sta = 1; //放电过程
-				}
-				break;
-        case 1:
-            if (mV_Charge > 20)
-            {
-                sta = 2; //充电过程
-                kg = 0;
-							
-							//解决插上充电没接电池状态下突然接上电池时电量不衔接的问题
-							if((mV_Battery<4000)&&(P1>95.0f))
-							{
-								P1=chargeV2P_f(mV_Battery);
-							}
-														
-            }
-            else
-            {
-                //---------------------------------------------------
-                P2 = Voltage2power(mV_Battery);
-                if (P1 > P2) //过滤刚拔掉充电线时候的虚高
-                {
-                    P1 = P2;
-                }	
-								
-								//解决充满电后充电器不拔出来的情况显示不到100%的情况
-								if(charge_in()&&(P1>95.0f))
-								{
-									P1=100.0f;
-								}
-
-                //---------------------------------------------------
-                //---------------------------------------------------
-            }
-            break;
-        case 2:
-            if (mV_Charge < 20)
-            {
-                sta = 1; //放电过程
-								//初始化滤波器波器
-                preBestResult_Voltage2power = mV_Battery / 10;
-                if (P1 > 99.1f)
-                {
-                    P1 = 100.0f;
-                }
-								
-//								//解决大电流充电的时候突然把电池拔掉
-//								if(mV_Battery>4100)
-//								{
-//									P1=Voltage2power(mV_Battery);
-//								}
-								
-            }
-            else
-            {
-                //---------------------------------------------------
-                mAh = mah2Voltage(P1, storage_capacity);
-                Charge(mV_Charge, &mAh, 1);
-                P_mAh = Voltage2mah(mAh, storage_capacity);
-                P2 = chargeV2P_f(mV_Battery);
-                kg = mV_Charge / 1000.0f;
-                if (kg > 1.0f)
-                {
-                    kg = 1.0f;
-                }
-                P2 = (1.0f - kg) * P2 + kg * P_mAh;
-                if (P1 < P2) //过滤刚插上充电线时候的虚低
-                {
-                    P1 = P2;
-                }
-                if (P1 > 100)
-                {
-                    P1 = 99.9;
-                }
-                //---------------------------------------------------
-                //                 P2=chargeV2P_f(mV_Battery);
-                //                 if(P1<P2)//过滤刚插上充电线时候的虚低
-                //                     P1=P2;
-                //---------------------------------------------------
-            }
-            break;
-    }
-    return P1;
-}
-
-static float adc_tp4056_power = 0;
-
-static void hal_battery_Process(void)
-{
-		#if PRINTBLE
-    char buff[256];
-		unsigned char len = 0;
-	  #endif
-    int16_t adcVal;
-    int16_t CHARGMEASURE;
-    int16_t volTemp;
-    int16_t volTemp_CHARGMEASURE;
-    
-    adcVal = ADC_GetValue(PIN_ADC_BAT_CHANNEL);
-    volTemp = ADC_RESULT_IN_MILLI_VOLTS(adcVal) * 5 / 3; // 电池电压转换计算
-    CHARGMEASURE = ADC_GetValue(PIN_ADC_CHARGMEASURE_CHANNEL);
-    volTemp_CHARGMEASURE = ADC_RESULT_IN_MILLI_VOLTS(CHARGMEASURE);// 电池电压转换计算
-	
-    adc_tp4056_power = Power_management((float)volTemp, (float)volTemp_CHARGMEASURE);
-	  #if PRINTBLE
-    len = sprintf(buff, "%4d ,%4d ,%4d,%f\r\n",TIME_GetTicks(), volTemp, volTemp_CHARGMEASURE, adc_tp4056_power);
-    send_bytes_client((unsigned char*)buff, len);
-	  #endif
-//		cli_process(&clirtt);
-//	  uint8_t persent = 0;
-//	  persent = (uint8_t)(adc_tp4056_power+0.5f);
-//	  DEBUG_LOG("hal_battery_Process:%d,%d\n",persent,volTemp);
-}
-
-
-
-
-//返回的电量范围: 0~100 表示电量百分比
-uint8_t GetBatteryPersent(void)
-{
-	uint8_t persent = 0;
-	persent = (uint8_t)(adc_tp4056_power+0.5f);
-	if(persent > 100)persent =100;
-	return persent;
-}
-//void battydeb_pcs(cli_t *p_cli, unsigned short argc, char **argv)
-//{
-
-//		cli_printf(p_cli, "GetBatteryPersent %d",GetBatteryPersent());
-
-//}
-//CLI_CMD_REGISTER(battydeb, "Cli cmd history", battydeb_pcs);
-void hal_battery_init(void){
-	hal_battery_Process();
-	Process_Start(1000,"hal_battery_Process",hal_battery_Process);
-}
-

+ 0 - 300
hal/hal_battery/hal_battery_NoPowerEnPin_12456.c

@@ -1,300 +0,0 @@
-/*********************************************************************
- * INCLUDES
- */
-#include "usr_config.h"
-#include "hal_battery.h"
-#include "cli.h"
-#define PRINTBLE 0
-
-#include "ble_comm.h"
-#include "exception.h"
-
-#include "ringframe.h"
-RINGFRAME_DEF(battlog,ringframe_size_4096);
-char logbuftemp[50];
-int logbuftemp_len=0;
-#define log(...) {logbuftemp_len = sprintf(logbuftemp,__VA_ARGS__); ringframe_in(&battlog,logbuftemp,logbuftemp_len);}
-
-#include "hal_ble_client.h"
-
-char print_log=0;
-void cb_BLE_Client_ERR(void* handle)
-{
-	BLE_Client_Rx_t *target = handle;
-	DEBUG_LOG("cb_BLE_Client_ERR:%d,%d\n",1,1);
-	print_log=1;
-}
-
-
-	
-
-int16_t ADC_GetValue(uint32_t channel)
-{
-	int16_t temp=0;
-	ADC_Read(channel, &temp);
-	return temp;
-}
-
-//返回5V信号,有5V的话返回1,没有的话返回0
-static char charge_in(void)
-{
-	uint32_t ch = nrf_gpio_pin_read(PIN_CHARGING);
-	if(ch)return 1;
-	else return 0;
-}
-
-static float filter(float value, float kg, float* preBestResult)
-{
-    float new_v = value;
-    new_v = *preBestResult * (1.0f - kg) + value * kg;
-    *preBestResult = new_v;
-    return new_v;
-}
-
-//负载测量仪
-//const float poo1o[]={5.10168165379740,5.34733044915476,5.61704724780813,5.91504952455148,6.24538762712249,6.61232594416931,7.01953712767654,7.46935265033756,7.96335122494516,8.50358200192486,9.09281468086492,9.73412484740972,10.4325753748233,11.1947240789575,12.0279998795062,12.9374916137117,13.9260172775225,14.9884510507725,16.1112400764950,17.2842706470249,18.5004202529463,19.7491314797588,21.0185653416731,22.2986943158191,23.5786963439054,24.8484876852771,26.0960349502041,27.3050010170951,28.4610454562188,29.5600116621742,30.6034682628590,31.5984702746944,32.5538106818571,33.4783670170583,34.3806559960012,35.2670128624846,36.1402606107567,36.9999854839693,37.8491813155179,38.6980882892879,39.5608382688438,40.4501589172903,41.3790038698800,42.3638365959298,43.4226235933126,44.5726867709324,45.8261573855592,47.1820084404052,48.6371187751347,50.1935842257010,51.8472994098979,53.5916193269800,55.4227167186607,57.3375320331711,59.3313953215555,61.3855139357523,63.4578870950691,65.4854598022728,67.4115262370806,69.2059495638218,70.8663781140949,72.4135268452713,73.8842849282509,75.3217897769173,76.7641290674375,78.2395953684845,79.7625546270391,81.3527328594521,83.0420141741465,84.8459239717299,86.7331023820235,88.6178189933847,90.3918821756187,91.9708771194967,93.3175662114905,94.4438984171043,95.3852594026215,96.1782551857171,96.8552759200241,97.4399007649065,97.9470337398631,98.3861216083791,98.7637272009236,99.0856995099079,99.3556936180377,99.5764952915733,99.7517164714185,99.8847888907893,99.9783503988427,100.038705667285,100.073274028685,100.088914482705,100.091844988568,100.087235862329,100.078726223926,100.068495717630,100.057471632431,100.046085695070,100.034540863310,100.022996031552,100.011610094200};
-
-//鞋子ADC
-static const float poo1o[] = {0, 0, 0.0279893723606430, 0.174605323652602, 0.325796538285416, 0.495164949358988, 0.661918800578876, 0.829024800123971, 1.00225498989324, 1.17936073685608, 1.37258677752597, 1.56525700069634, 1.78680072433224, 2.00361106262195, 2.24466616203811, 2.46699160701705, 2.77834696254638, 3.12186809827754, 3.58442625993982, 4.15025435558636, 4.75855743544068, 5.51189718744822, 6.35834306864975, 7.38461196888009, 8.48997478633724, 9.43096936165977, 10.3817319764220, 11.4116388420216, 12.3939372566211, 13.5048186806524, 14.5904959858255, 15.5237940825920, 16.4790857938893, 17.8137595522187, 18.9982251103467, 20.3392608271850, 21.5817542329461, 22.7218253119165, 23.9444316340532, 25.2939077624602, 26.6264082603126, 27.6802415218000, 29.0022881606974, 30.1783424265851, 31.1179209268523, 32.2887764986448, 33.3732790985050, 34.2380544358441, 35.2041112278740, 36.0163848326001, 36.8624779801428, 37.6634899287154, 38.5186413495501, 39.4878256764553, 40.2471232681709, 41.2081417271725, 42.3322924899204, 43.7047997876243, 44.9058976548061, 46.5044971286874, 47.8927266715832, 49.8558978793141, 51.9022338412845, 54.2586141300707, 56.3903798469888, 58.7696803719223, 60.8764981712366, 62.2358527791606, 63.8383633243999, 65.5021323737117, 67.1556090613014, 69.0159229136298, 70.1420773342446, 71.2282683025524, 72.4548338447843, 73.6556507850819, 74.8128040906371, 75.8695501837768, 77.1323517287879, 78.6365237973046, 80.3752005495001, 82.8468947240450, 86.6163997907370, 91.2910588313494, 93.9702969410882, 95.4930183746766, 96.9114001488224, 97.8493292727541, 98.7169169431273, 99.3270162091455, 99.6869018017068, 99.9917942993789, 99.9689500363163, 99.97, 99.98, 99.98, 99.98, 99.98, 99.99, 99.99, 99.99};
-static float interp1(float x)
-{
-    int absx = (int)x - 320;
-    float max = poo1o[absx + 1];
-    float min = poo1o[absx];
-    float temp = x - (float)absx - 320.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_Voltage2power = 0;
-static float Voltage2power(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_Voltage2power = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.01, &preBestResult_Voltage2power);
-    if (k < 320.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1(k);
-    }
-    return rev;
-}
-
-static const float chargeV2P[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0.606184684199367, 0.938307744774148, 1.30769659743727, 1.87378869014097, 2.39210582883903, 2.92471759425620, 3.79782257541779, 4.54241638183623, 5.09886597521223, 5.98930945903392, 6.49613916536905, 7.57967916311061, 8.42757721701290, 9.26589943580526, 10.3408809248851, 11.4278317273525, 12.3098089504989, 13.8095299712012, 15.4373756551577, 16.8805115746597, 18.4871688551768, 20.0578462608782, 21.6336381358003, 22.9916066660508, 24.4652374859292, 25.6565902258290, 26.8453581267414, 27.9070922567514, 28.9713295466563, 30.0209078713242, 30.9380166385130, 32.0419258329631, 33.1827748787620, 33.8691297160915, 34.8949274023278, 35.8840553861847, 36.9638277084030, 37.8687458690322, 38.9939274175310, 40.4336758333268, 41.1114865403869, 42.6160733592240, 44.2493873543177, 45.6026105469954, 47.4664557187522, 49.0734043728910, 51.2998758679562, 52.8880367841713, 54.7587352342972, 57.0178625862682, 58.8608281071146, 60.3657347075748, 62.4281274954232, 64.3086188700345, 65.8044424890286, 68.6475622104224, 72.7352289117192, 76.9893033499930, 84.0930819869950, 92.2923770276700, 96.3286261252036, 99.7542287364423};
-static float interp1_chargeV2P(float x)
-{
-    int absx = (int)x - 350;
-    float max = chargeV2P[absx + 1];
-    float min = chargeV2P[absx];
-    float temp = x - (float)absx - 350.0f;
-    return (max - min) * temp + min;
-}
-//返回电压百分比
-static float preBestResult_chargeV2P_f = 0;
-static float chargeV2P_f(float mV)
-{
-    float rev = 0;
-    float k = 0;
-    static char init = 1;
-    if (init)
-    {
-        preBestResult_chargeV2P_f = mV / 10;
-        init = 0;
-    }
-    k = filter(mV / 10, 0.05, &preBestResult_chargeV2P_f);
-    if (k < 350.0f)
-    {
-        rev = 0;
-    }
-    else if (k > 420.0f)
-    {
-        rev = 100;
-    }
-    else
-    {
-        rev = interp1_chargeV2P(k);
-    }
-    return rev;
-}
-
-//返回电量百分比
-static float Voltage2mah(float mah, float storage_capacity)
-{
-    return mah / storage_capacity * 100.0f;
-}
-//返回电压剩余绝对容量
-static float mah2Voltage(float P, float storage_capacity)
-{
-    return storage_capacity * P / 100.0f;
-}
-
-static void Charge(float mV, float* mAh, float interval_s)
-{
-    float A = mV / 3000.0f * 1.1f;
-    float dmAh = A * 1000.0f * interval_s / 3600.0f;
-    *mAh = *mAh + dmAh;
-}
-static char sta = 0;float P_mAh = 0;static float kg = 0;
-static float P2 = 0;
-static float Power_management(float mV_Battery, float mV_Charge)
-{
-    static float P1 = 100;
-    
-    
-    float storage_capacity = 350;
-    static float mAh = 0;
-    
-    
-    switch (sta)
-    {
-			case 0:
-				if (mV_Charge > 20)
-				{
-					sta = 2; //充电过程
-					P1=chargeV2P_f(mV_Battery);
-				}
-				else
-				{
-					P1 = Voltage2power(mV_Battery);
-					sta = 1; //放电过程
-				}
-				break;
-        case 1://放电
-            if (mV_Charge > 20)
-            {
-                sta = 2; //充电过程
-                kg = 0;
-							
-							//解决插上充电没接电池状态下突然接上电池时电量不衔接的问题
-							if((mV_Battery<4000)&&(P1>95.0f))
-							{
-								P1=chargeV2P_f(mV_Battery);
-							}														
-            }
-            else
-            {
-                P2 = Voltage2power(mV_Battery);
-                if (P1 > P2) //过滤刚拔掉充电线时候的虚高
-                {
-                    P1 = P2;
-                }	
-								
-								//解决充满电后充电器不拔出来的情况显示不到100%的情况
-								if(charge_in()&&(P1>95.0f))
-								{
-									P1=100.0f;
-								}
-            }
-            break;
-        case 2://充电
-            if (mV_Charge < 20)
-            {
-                sta = 1; //放电过程
-								//初始化滤波器波器
-                preBestResult_Voltage2power = mV_Battery / 10;
-                if (P1 > 99.1f)
-                {
-                    P1 = 100.0f;
-                }
-            }
-            else
-            {
-                //---------------------------------------------------
-                mAh = mah2Voltage(P1, storage_capacity);
-                Charge(mV_Charge, &mAh, 1);
-                P_mAh = Voltage2mah(mAh, storage_capacity);
-                P2 = chargeV2P_f(mV_Battery);
-                kg = mV_Charge / 1000.0f;
-                if (kg > 1.0f)
-                {
-                    kg = 1.0f;
-                }
-                P2 = (1.0f - kg) * P2 + kg * P_mAh;
-                if (P1 < P2) //过滤刚插上充电线时候的虚低
-                {
-                    P1 = P2;
-                }
-                if (P1 > 100)
-                {
-                    P1 = 99.9;
-                }
-            }
-            break;
-    }
-    return P1;
-}
-
-static float adc_tp4056_power = 0;
-
-static void hal_battery_Process(void)
-{
-	static int cprign=0;
-		#if PRINTBLE
-    char buff[256];
-		unsigned char len = 0;
-	  #endif
-    int16_t adcVal;
-    int16_t CHARGMEASURE;
-    int16_t volTemp;
-    int16_t volTemp_CHARGMEASURE;
-    
-    adcVal = ADC_GetValue(PIN_ADC_BAT_CHANNEL);
-    volTemp = ADC_RESULT_IN_MILLI_VOLTS(adcVal) * 5 / 3; // 电池电压转换计算
-    CHARGMEASURE = ADC_GetValue(PIN_ADC_CHARGMEASURE_CHANNEL);
-    volTemp_CHARGMEASURE = ADC_RESULT_IN_MILLI_VOLTS(CHARGMEASURE);// 电池电压转换计算
-    adc_tp4056_power = Power_management((float)volTemp, (float)volTemp_CHARGMEASURE);
-	  #if PRINTBLE
-    len = sprintf(buff, "%4d ,%4d ,%4d,%f\r\n",TIME_GetTicks(), volTemp, volTemp_CHARGMEASURE, adc_tp4056_power);
-    send_bytes_client((unsigned char*)buff, len);
-	  #endif
-	
-	if(cprign%3==0){
-		log("%4d,%4d,%4d,%2.1f,%d,%2.1f,%2.1f,%2.1f\n",TIME_GetTicks(),volTemp, volTemp_CHARGMEASURE, adc_tp4056_power,sta,P_mAh,P2,kg);
-		logbuftemp[logbuftemp_len]=0;
-		Except_TxError(EXCEPT_DATA_BATTERY,logbuftemp);
-	}cprign++;
-//		cli_process(&clirtt);
-//	  uint8_t persent = 0;
-//	  persent = (uint8_t)(adc_tp4056_power+0.5f);
-//	  DEBUG_LOG("hal_battery_Process:%d,%d\n",persent,volTemp);
-		if(print_log)
-		{
-			unsigned char length=0;
-			while(ringframe_out(&battlog,logbuftemp,&length)==0)
-			{
-				while(send_bytes_client((unsigned char*)logbuftemp, length)!=0);
-				SEGGER_RTT_Write(0,logbuftemp, length);
-			}
-			print_log=0;
-		}
-}
-
-
-
-
-//返回的电量范围: 0~100 表示电量百分比
-uint8_t GetBatteryPersent(void)
-{
-	uint8_t persent = 0;
-	persent = (uint8_t)(adc_tp4056_power+0.5f);
-	if(persent > 100)persent =100;
-	return persent;
-}
-void hal_battery_init(void){
-	hal_battery_Process();
-	BLE_Client_Rx_Regist(BLE_ERR,cb_BLE_Client_ERR);
-	Process_Start(1000,"hal_battery_Process",hal_battery_Process);
-}
-

+ 2 - 2
hal/hal_ble_common.h

@@ -58,9 +58,9 @@ enum { //BLE_CHARGE
 
 //右鞋连接状态
 enum { //BLE_RIGHT_STATE
-	BLE_RIGHT_DISCONNTED = 0,	//没有配置 
+	BLE_RIGHT_DISCONNTED = 0,	//断开 
 	BLE_RIGHT_CONNTED,		    //连接
-	BLE_RIGHT_NOCONFIG        //断开
+	BLE_RIGHT_NOCONFIG        //没有配置
 };
 
 enum { //BLE_REALTIMESTEP

+ 2 - 3
hal/hal_charge.c

@@ -8,7 +8,6 @@
 #include "app_flash.h"
 #include "hal_battery.h"
 #include "ble_comm.h"
-#include "hal_ble_uart0.h"
 #include "app_pair_chargerpin.h"
 #include "hal_charge.h"
 
@@ -77,7 +76,7 @@ static uint8_t OtherShoesVol = 0;
 static uint8_t otherShoes_charge = BLE_CHARGE_PULLOUT;
 static void cb_BLE_R_CHAR_VOL(void* handle)
 {	
-	UART0_Rx_t* target = handle;
+	BLE_Client_Rx_t* target = handle;
 	OtherShoesVol = target->pDat[0];
 	otherShoes_charge = target->pDat[1];
 	if(!mFlash.isHost)hal_charge_Vol_Charge_Send();
@@ -86,7 +85,7 @@ static void cb_BLE_R_CHAR_VOL(void* handle)
 
 static void cb_BLE_Host_R_CHAR_VOL(void* handle)
 {	
-	UART0_Rx_t* target = handle;
+	BLE_Host_Rx_t* target = handle;
 	OtherShoesVol = target->pDat[0];
 	otherShoes_charge = target->pDat[1];
 //	DEBUG_LOG("OtherShoesVol=%d\n",OtherShoesVol);

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 5 - 5
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


+ 3 - 4
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.build_log.htm

@@ -22,12 +22,11 @@ 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.2\shoe_mcu\pca10040\s132\arm5_no_packs\ble_app_uart_c_pca10040_s132.uvprojx
-Project File Date:  07/05/2022
+Project File Date:  07/09/2022
 
 <h2>Output:</h2>
 *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
 Build target 'Shoes_FW_APP'
-FromELF: creating hex file...
 ".\_build\nrf52832_xxaa.axf" - 0 Error(s), 0 Warning(s).
 
 <h2>Software Packages used:</h2>
@@ -54,10 +53,10 @@ Package Vendor: NordicSemiconductor
    * Component: ARM::CMSIS:CORE:5.3.0
 
    * Component: NordicSemiconductor::Device:Startup:8.32.1
-      Source file:   Device\Source\arm\arm_startup_nrf52.s
       Include file:  Device\Include\system_nrf.h
-      Source file:   Device\Source\system_nrf52.c
       Include file:  Device\Include\system_nrf52.h
+      Source file:   Device\Source\system_nrf52.c
+      Source file:   Device\Source\arm\arm_startup_nrf52.s
 Build Time Elapsed:  00:00:01
 </pre>
 </body>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 398 - 398
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.hex


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1936 - 2100
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.htm


+ 0 - 24
pca10040/s132/arm5_no_packs/_build/nrf52832_xxaa.lnp

@@ -25,7 +25,6 @@
 ".\_build\hal_ble_client.o"
 ".\_build\hal_ble_host.o"
 ".\_build\hal_mt.o"
-".\_build\hal_ble_uart0_hastxdenpin.o"
 ".\_build\hal_battery_nopowerenpin.o"
 ".\_build\hal_dfu.o"
 ".\_build\hal_wearshoes.o"
@@ -68,7 +67,6 @@
 ".\_build\detect_step_by_acc_gyr.o"
 ".\_build\detect_zero_vel.o"
 ".\_build\detect_step_by_mag.o"
-".\_build\boards.o"
 ".\_build\utf.o"
 ".\_build\ble_advdata.o"
 ".\_build\ble_db_discovery.o"
@@ -81,29 +79,13 @@
 ".\_build\ble_conn_params.o"
 ".\_build\ble_link_ctx_manager.o"
 ".\_build\nrf_ble_qwr.o"
-".\_build\auth_status_tracker.o"
-".\_build\gatt_cache_manager.o"
-".\_build\gatts_cache_manager.o"
-".\_build\id_manager.o"
-".\_build\nrf_ble_lesc.o"
-".\_build\peer_database.o"
-".\_build\peer_id.o"
-".\_build\pm_buffer.o"
-".\_build\security_dispatcher.o"
-".\_build\security_manager.o"
-".\_build\peer_data_storage.o"
-".\_build\peer_manager.o"
 ".\_build\ble_nus_c.o"
 ".\_build\ble_nus.o"
 ".\_build\nrf_drv_clock.o"
-".\_build\nrf_drv_uart.o"
 ".\_build\nrfx_atomic.o"
 ".\_build\nrfx_clock.o"
 ".\_build\nrfx_gpiote.o"
-".\_build\nrfx_uart.o"
-".\_build\nrfx_uarte.o"
 ".\_build\nrfx_rtc.o"
-".\_build\nrf_nvmc.o"
 ".\_build\nrfx_saadc.o"
 ".\_build\nrfx_timer.o"
 ".\_build\nrfx_pwm.o"
@@ -111,20 +93,15 @@
 ".\_build\nrfx_spi.o"
 ".\_build\nrf_drv_spi.o"
 ".\_build\nrfx_spim.o"
-".\_build\app_button.o"
 ".\_build\app_error_handler_keil.o"
 ".\_build\app_error_weak.o"
-".\_build\app_fifo.o"
 ".\_build\app_scheduler.o"
-".\_build\app_uart_fifo.o"
 ".\_build\app_util_platform.o"
 ".\_build\hardfault_implementation.o"
 ".\_build\nrf_assert.o"
 ".\_build\nrf_atfifo.o"
 ".\_build\nrf_atomic.o"
 ".\_build\nrf_balloc.o"
-".\_build\nrf_fprintf.o"
-".\_build\nrf_fprintf_format.o"
 ".\_build\nrf_memobj.o"
 ".\_build\nrf_pwr_mgmt.o"
 ".\_build\nrf_queue.o"
@@ -132,7 +109,6 @@
 ".\_build\nrf_section_iter.o"
 ".\_build\nrf_sortlist.o"
 ".\_build\nrf_strerror.o"
-".\_build\retarget.o"
 ".\_build\nrf_fstorage.o"
 ".\_build\nrf_atflags.o"
 ".\_build\crc16.o"

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 8 - 9
pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvguix.Administrator


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 147 - 415
pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvoptx


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 169 - 858
pca10040/s132/arm5_no_packs/ble_app_uart_c_pca10040_s132.uvprojx


+ 10 - 23
pca10040/s132/config/sdk_config.h

@@ -62,19 +62,6 @@
 // </h> 
 //==========================================================
 
-// <h> Board Support 
-
-//==========================================================
-// <q> BSP_BTN_BLE_ENABLED  - bsp_btn_ble - Button Control for BLE
- 
-
-#ifndef BSP_BTN_BLE_ENABLED
-#define BSP_BTN_BLE_ENABLED 1
-#endif
-
-// </h> 
-//==========================================================
-
 // <h> nRF_BLE 
 
 //==========================================================
@@ -278,7 +265,7 @@
 // <e> PEER_MANAGER_ENABLED - peer_manager - Peer Manager
 //==========================================================
 #ifndef PEER_MANAGER_ENABLED
-#define PEER_MANAGER_ENABLED 1
+#define PEER_MANAGER_ENABLED 0
 #endif
 // <o> PM_MAX_REGISTRANTS - Number of event handlers that can be registered. 
 #ifndef PM_MAX_REGISTRANTS
@@ -2091,7 +2078,7 @@
 // <e> NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver
 //==========================================================
 #ifndef NRFX_GPIOTE_ENABLED
-#define NRFX_GPIOTE_ENABLED 1
+#define NRFX_GPIOTE_ENABLED 0
 #endif
 // <o> NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins 
 #ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
@@ -4461,7 +4448,7 @@
 // <e> NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver
 //==========================================================
 #ifndef NRFX_UARTE_ENABLED
-#define NRFX_UARTE_ENABLED 1
+#define NRFX_UARTE_ENABLED 0
 #endif
 // <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance 
 #ifndef NRFX_UARTE0_ENABLED
@@ -4582,7 +4569,7 @@
 // <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
 //==========================================================
 #ifndef NRFX_UART_ENABLED
-#define NRFX_UART_ENABLED 1
+#define NRFX_UART_ENABLED 0
 #endif
 // <o> NRFX_UART0_ENABLED - Enable UART0 instance 
 #ifndef NRFX_UART0_ENABLED
@@ -5942,7 +5929,7 @@
 // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
 //==========================================================
 #ifndef UART_ENABLED
-#define UART_ENABLED 1
+#define UART_ENABLED 0
 #endif
 // <o> UART_DEFAULT_CONFIG_HWFC  - Hardware Flow Control
  
@@ -6166,7 +6153,7 @@
  
 
 #ifndef APP_FIFO_ENABLED
-#define APP_FIFO_ENABLED 1
+#define APP_FIFO_ENABLED 0
 #endif
 
 // <q> APP_GPIOTE_ENABLED  - app_gpiote - GPIOTE events dispatcher
@@ -6347,7 +6334,7 @@
 // <e> APP_UART_ENABLED - app_uart - UART driver
 //==========================================================
 #ifndef APP_UART_ENABLED
-#define APP_UART_ENABLED 1
+#define APP_UART_ENABLED 0
 #endif
 // <o> APP_UART_DRIVER_INSTANCE  - UART instance used
  
@@ -7469,7 +7456,7 @@
  
 
 #ifndef RETARGET_ENABLED
-#define RETARGET_ENABLED 1
+#define RETARGET_ENABLED 0
 #endif
 
 // <q> SLIP_ENABLED  - slip - SLIP encoding and decoding
@@ -7530,7 +7517,7 @@
  
 
 #ifndef BUTTON_ENABLED
-#define BUTTON_ENABLED 1
+#define BUTTON_ENABLED 0
 #endif
 
 // <q> BUTTON_HIGH_ACCURACY_ENABLED  - Enables GPIOTE high accuracy for buttons
@@ -7674,7 +7661,7 @@
  
 
 #ifndef NRF_FPRINTF_ENABLED
-#define NRF_FPRINTF_ENABLED 1
+#define NRF_FPRINTF_ENABLED 0
 #endif
 
 // <q> NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED  - For each printed LF, function will add CR.

+ 2 - 2
system/system.h

@@ -21,10 +21,10 @@ typedef struct _PROCESS{	//
 	#endif
 }PROCESS_t;
 
-#if 0
+#if DEBUGLOG_ENABLE
 #define DEBUG_LOG(format,...) SEGGER_RTT_printf(0,format, ##__VA_ARGS__);
 #else 
-#define DEBUG_LOG(format,...) ;
+#define DEBUG_LOG(format,...) 
 #endif
 
 int Sleep_Regist(Sleep_cb cb);			//ÐÝÃß֮ǰµÄ»Øµ÷×¢²á

+ 0 - 1
system/usr.c

@@ -16,7 +16,6 @@
 #include "app_client.h"
 #include "app_host.h"
 #include "app_game.h"
-#include "hal_ble_uart0.h"
 #include "app_config.h"
 #include "app_ota.h"
 #include "app_connect_manage.h"

+ 8 - 3
system/usr_config.h

@@ -5,7 +5,7 @@
 #define SHOES_NAME "SMART SHOE"
 #define SHOES_NAME_LEN  64
 #define HARDWARE_VERSION	0x00010201
-#define SOFTWARE_VERSION	0x0010
+#define SOFTWARE_VERSION	0x0011
 
 // <h> 公共
 
@@ -35,6 +35,7 @@
 #ifndef ProcessTime_EN
 #define ProcessTime_EN 0
 #endif
+
 #if ProcessTime_EN
 // <o> DisInterval  - 线程时间显示间隔
 #define DisInterval 1000
@@ -42,6 +43,12 @@
 #endif
 // </e> 
 
+// <e> DEBUGLOG_ENABLE  - SEGGER RTT打印
+#ifndef DEBUGLOG_ENABLE
+#define DEBUGLOG_ENABLE 0
+#endif
+// </e> 
+
 // <o> UART_HZ - 串口频率
 #ifndef UART_HZ
 #define UART_HZ 250000
@@ -223,8 +230,6 @@
 #define WDT_IRQ_PRIORITY 6
 #endif
 
-
-
 // </h> 
 
 // </h> 

+ 7 - 2
版本更新记录.txt

@@ -1,2 +1,7 @@
-1.  更新算法。
-2.  取消鞋子蓝牙的时间校准
+1.  优化app获取左右鞋连接的信号
+2.  优化电池电量的检测。
+3.  删除uart串口的相关文件
+4.  关闭peer manager(配对绑定管理)的使能
+5.  关闭GPIOTE peripheral driver的使能
+6.  关闭app_button的使能
+7.  关闭fprintf module的使能

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä