|
@@ -0,0 +1,560 @@
|
|
|
+#include "app_flash.h"
|
|
|
+#include "bsp_wdt.h"
|
|
|
+#include "exception.h"
|
|
|
+#include "system.h"
|
|
|
+#include "hal_minifds.h"
|
|
|
+#include "nrf_sdh_soc.h"
|
|
|
+#include "app_step.h"
|
|
|
+#include "nrf_pwr_mgmt.h"
|
|
|
+#include "bsp_flash.h"
|
|
|
+
|
|
|
+/*************************************
|
|
|
+ *DEFINITION
|
|
|
+ */
|
|
|
+#define FLASH_HEAD 0xAA5555AA
|
|
|
+
|
|
|
+#define FLASH_START_ADDR_INFOR 0x00074000UL
|
|
|
+#define FLASH_END_ADDR_INFOR 0x00076000UL
|
|
|
+#define FLASH_ADDR_INFOR_PAGENUM 2
|
|
|
+
|
|
|
+#define FLASH_START_ADDR_STEP 0x00076000UL
|
|
|
+#define FLASH_END_ADDR_STEP 0x00077FFFUL
|
|
|
+#define FLASH_ADDR_STEP_PAGENUM 2
|
|
|
+
|
|
|
+#define MaxLength(a,b) a>b?a:b
|
|
|
+
|
|
|
+typedef struct t_mflash_param_type{
|
|
|
+ const char *name; //参数名字
|
|
|
+ void *value; //数据指针
|
|
|
+ const uint8_t length; //数据长度
|
|
|
+}mflash_param_type;
|
|
|
+
|
|
|
+#define MAX_mflash_param_LENGTH 27
|
|
|
+
|
|
|
+const mflash_param_type All_Falsh_value[MAX_mflash_param_LENGTH]={
|
|
|
+{"inforhead",&mFlash.head,4},//不可调整
|
|
|
+//{"ErrStartCnt",&mFlash.ErrStartCnt,1},
|
|
|
+{"macHost",mFlash.macHost,6},
|
|
|
+{"IsHost",&mFlash.isHost,1},
|
|
|
+
|
|
|
+{"startTime",mFlash.mStep.startTime,8},
|
|
|
+{"stepCur",mFlash.mStep.stepCur,8},
|
|
|
+
|
|
|
+{"step",mFlash.mStep.step,8},
|
|
|
+{"step_num",&mFlash.mStep.step_num,4},
|
|
|
+{"C_isConfig",&mFlash.mClient.isConfig,1},
|
|
|
+{"C_hard",&mFlash.mClient.hardVersion,4},
|
|
|
+{"C_sotf",&mFlash.mClient.sotfVersion,2},
|
|
|
+{"C_macAddr",&mFlash.mClient.macAddr,6},
|
|
|
+{"Errorflag",&mFlash.mFlashLog.Errorflag,1},
|
|
|
+{"logData",mFlash.mFlashLog.logData,50},
|
|
|
+{"PB_BR_V2E",&mFlash.mbattercb_t.preBestResult_Voltage2power,4},
|
|
|
+{"PB_BR_C2P",&mFlash.mbattercb_t.preBestResult_chargeV2P_f,4},
|
|
|
+{"PB_P_MAH",&mFlash.mbattercb_t.P_mAh,4},
|
|
|
+{"PB_KG", &mFlash.mbattercb_t.kg,4},
|
|
|
+{"PP2", &mFlash.mbattercb_t.P2,4},
|
|
|
+{"PP1", &mFlash.mbattercb_t.P1,4},
|
|
|
+{"PCAP_MAH",&mFlash.mbattercb_t.Battery_capacity_mAh,4},
|
|
|
+{"PTP4056",&mFlash.mbattercb_t.adc_tp4056_power,4},
|
|
|
+{"PINIT", &mFlash.mbattercb_t.init,1},
|
|
|
+{"PSTA", &mFlash.mbattercb_t.sta,1},
|
|
|
+{"PCV2P_INIT",&mFlash.mbattercb_t.chargeV2P_f_init,1},
|
|
|
+{"PV2P_INIT",&mFlash.mbattercb_t.Voltage2power_init,1},
|
|
|
+
|
|
|
+{"Safe_cnt",&mFlash.Safe_cnt,1},
|
|
|
+{"RestartCnt",&mFlash.RestartCnt,1}
|
|
|
+};
|
|
|
+
|
|
|
+DEFINE_MINIINF(information, FLASH_START_ADDR_INFOR, FLASH_END_ADDR_INFOR, sdflash_write, sdflash_page_erase);
|
|
|
+
|
|
|
+Flash_t mFlash={0};
|
|
|
+
|
|
|
+const uint8_t oldflashdata[] ={
|
|
|
+0x01,0X00,0XE8,0X0E,0X69,0X6E,0X66,0X6F,0X72,0X68,0X65,0X61,0X64,0X3A,0XAA,0X55,0X55,0XAA,0X00,0X00,0X00,0X00,0X09,0X0E,0X6D,0X61,0X63,0X48,0X6F,0X73,0X74,0X3A,
|
|
|
+0x00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X00,0X95,0X08,0X49,0X73,0X48,0X6F,0X73,0X74,0X3A,0X01,0X00,0X00,0XF7,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,
|
|
|
+0x65,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
|
|
|
+0x00,0X00,0XF6,0X0D,0X73,0X74,0X65,0X70,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XA5,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0E,0X0C,0X43,0X5F,0X69,0X73,0X43,0X6F,0X6E,0X66,0X69,0X67,0X3A,0X00,0X00,0X00,0X7B,0X0B,0X43,0X5F,0X68,0X61,
|
|
|
+0x72,0X64,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X98,0X09,0X43,0X5F,0X73,0X6F,0X74,0X66,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X88,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X00,0XDE,0X0B,0X45,0X72,0X72,0X6F,0X72,0X66,0X6C,0X61,0X67,0X3A,0X00,0X00,0X0D,0X00,0XF6,0X3A,
|
|
|
+0x6C,0X6F,0X67,0X44,0X61,0X74,0X61,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
|
|
|
+0x00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,0X00,0X00,0XEB,0X0E,
|
|
|
+0x50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE3,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X43,0X32,0X50,0X3A,0X00,0X00,
|
|
|
+0x00,0X00,0X00,0X00,0X00,0X00,0XB0,0X0D,0X50,0X42,0X5F,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XBD,0X0A,0X50,0X42,0X5F,0X4B,
|
|
|
+0x47,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X08,0X50,0X50,0X32,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X0B,0X08,0X50,0X50,0X31,0X3A,0X00,0X00,0X00,0X00,
|
|
|
+0x00,0X00,0X93,0X0D,0X50,0X43,0X41,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFD,0X0C,0X50,0X54,0X50,0X34,0X30,0X35,0X36,0X3A,
|
|
|
+0x00,0X00,0X00,0X00,0X00,0X00,0XBE,0X07,0X50,0X49,0X4E,0X49,0X54,0X3A,0X00,0X3A,0X00,0X00,0X72,0X06,0X50,0X53,0X54,0X41,0X3A,0X00,0X00,0X3A,0X00,0X00,0X38,0X0C,
|
|
|
+0x50,0X43,0X56,0X32,0X50,0X5F,0X49,0X4E,0X49,0X54,0X3A,0X00,0X19,0X00,0XF5,0X0B,0X50,0X56,0X32,0X50,0X5F,0X49,0X4E,0X49,0X54,0X3A,0X00,0X00,0X1A,0X00,0X5D,0X0A,
|
|
|
+0x53,0X61,0X66,0X65,0X5F,0X63,0X6E,0X74,0X3A,0X00,0X00,0X00,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X02,0X00,0X57,0X0E,
|
|
|
+0x6D,0X61,0X63,0X48,0X6F,0X73,0X74,0X3A,0X4B,0X1E,0X15,0X45,0XAA,0XE1,0X00,0X20,0X08,0X00,0X51,0X0C,0X43,0X5F,0X69,0X73,0X43,0X6F,0X6E,0X66,0X69,0X67,0X3A,0X43,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,
|
|
|
+0x6E,0X74,0X3A,0X01,0X00,0X00,0XE6,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,0X65,0X3A,0X00,0X00,0X01,0X81,0X66,0XCE,0X39,0X00,0X04,0X00,0X00,0X00,0X55,0X10,
|
|
|
+0x73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0X6C,0X03,0X00,0X00,0XAD,0X19,0X00,0X00,0X00,0X00,0X2B,0X0D,0X73,0X74,0X65,0X70,0X3A,0X6C,0X03,0X00,0X00,0XAD,0X19,0X00,
|
|
|
+0x00,0X19,0X00,0X00,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X01,0X00,0X00,0X00,0X19,0X00,0X00,0X09,0X00,0X7F,0X0B,0X43,0X5F,0X68,0X61,
|
|
|
+0x72,0X64,0X3A,0X01,0X02,0X01,0X00,0X43,0X0A,0X00,0X99,0X09,0X43,0X5F,0X73,0X6F,0X74,0X66,0X3A,0X01,0X00,0X01,0X00,0X43,0X00,0X00,0X74,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XC4,0X96,0X94,0X5F,0X18,0X87,0X00,0X00,0X12,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0X8E,0X05,0X00,0X00,0X44,0X1B,0X00,0X00,
|
|
|
+0x00,0X00,0XE8,0X0D,0X73,0X74,0X65,0X70,0X3A,0X8E,0X05,0X00,0X00,0X44,0X1B,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XA5,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,
|
|
|
+0xDC,0X05,0X00,0X00,0X89,0X1B,0X00,0X00,0X00,0X00,0X7B,0X0D,0X73,0X74,0X65,0X70,0X3A,0XDC,0X05,0X00,0X00,0X89,0X1B,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XA7,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XA8,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X03,0X00,0X00,
|
|
|
+0x00,0X1B,0X00,0X00,0X00,0X00,0XA9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X04,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XAA,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X05,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XAB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X06,0X00,0X00,0X00,0X1B,0X00,0X00,
|
|
|
+0x00,0X00,0XAC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X07,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XAD,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X08,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XAE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X09,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XAF,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0A,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XB0,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0B,0X00,0X00,
|
|
|
+0x00,0X1B,0X00,0X00,0X00,0X00,0XB1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0C,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XB2,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X0D,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0XB3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0E,0X00,0X00,0X00,0X1B,0X00,0X00,
|
|
|
+0x00,0X00,0XB4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0F,0X00,0X00,0X00,0X1B,0X00,0X00,0X00,0X00,0X0D,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,
|
|
|
+0xD1,0X07,0X00,0X00,0XF9,0X1C,0X00,0X00,0X00,0X00,0XE3,0X0D,0X73,0X74,0X65,0X70,0X3A,0XD1,0X07,0X00,0X00,0XF9,0X1C,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X10,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X41,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,0X65,0X3A,0X00,0X00,
|
|
|
+0x01,0X81,0X6A,0X3D,0X21,0X00,0X04,0X00,0X00,0X00,0X17,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XFD,0X1C,0X00,0X00,0X00,0X00,0XED,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X3A,0XD7,0X07,0X00,0X00,0XFD,0X1C,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X01,0X00,0X00,
|
|
|
+0x00,0X1C,0X00,0X00,0X00,0X00,0XA7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XA8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X03,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XA9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X04,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0XAA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X05,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XAB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X06,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XAC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X07,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XAD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X08,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XAE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X09,0X00,0X00,
|
|
|
+0x00,0X1C,0X00,0X00,0X00,0X00,0XAF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0A,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB0,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X0B,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0C,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0XB2,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0D,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X0E,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0F,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X10,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X11,0X00,0X00,
|
|
|
+0x00,0X1C,0X00,0X00,0X00,0X00,0XB7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X12,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X13,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X14,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0XBA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X15,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XBB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X16,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XBC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X17,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XBD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X18,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XBE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X19,0X00,0X00,
|
|
|
+0x00,0X1C,0X00,0X00,0X00,0X00,0XBF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X1A,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XB1,0X0E,0X50,0X42,0X5F,0X42,
|
|
|
+0x52,0X5F,0X56,0X32,0X45,0X3A,0X0C,0XC2,0XB5,0X43,0X00,0X00,0X00,0X00,0X7C,0X0A,0X50,0X42,0X5F,0X4B,0X47,0X3A,0X00,0X00,0X80,0X3F,0X00,0X00,0X00,0X00,0X7A,0X08,
|
|
|
+0x50,0X50,0X32,0X3A,0X30,0X08,0XF5,0X41,0X00,0X00,0XCA,0X08,0X50,0X50,0X31,0X3A,0XA0,0XEA,0XF4,0X41,0X00,0X00,0XBC,0X0C,0X50,0X54,0X50,0X34,0X30,0X35,0X36,0X3A,
|
|
|
+0xA0,0XEA,0XF4,0X41,0X16,0X00,0XC1,0X07,0X50,0X49,0X4E,0X49,0X54,0X3A,0X03,0X3A,0X17,0X00,0X73,0X06,0X50,0X53,0X54,0X41,0X3A,0X01,0X03,0X3A,0X00,0X00,0X39,0X0C,
|
|
|
+0x50,0X43,0X56,0X32,0X50,0X5F,0X49,0X4E,0X49,0X54,0X3A,0X01,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0X73,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,
|
|
|
+0x00,0X00,0X6D,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,0X65,0X3A,0X00,0X00,0X01,0X81,0X6F,0X9A,0X6B,0X80,0X00,0X00,0X00,0X00,0XA5,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X00,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,
|
|
|
+0x72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0XE2,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XE0,0X04,0X00,0X00,0X00,0X00,0X73,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X17,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,
|
|
|
+0xFD,0X1C,0X00,0X00,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0XE2,0X10,0X73,0X74,0X65,0X70,
|
|
|
+0x43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XE0,0X04,0X00,0X00,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,
|
|
|
+0x00,0X00,0X17,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XFD,0X1C,0X00,0X00,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X01,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X98,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0X72,0X43,0XB5,0X43,0X00,0X00,0X00,0X00,0X15,0X08,
|
|
|
+0x50,0X50,0X32,0X3A,0XC8,0X0D,0XF3,0X41,0X00,0X00,0XC6,0X08,0X50,0X50,0X31,0X3A,0XC4,0XC5,0XF1,0X41,0X00,0X00,0XB8,0X0C,0X50,0X54,0X50,0X34,0X30,0X35,0X36,0X3A,
|
|
|
+0xC4,0XC5,0XF1,0X41,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,
|
|
|
+0x72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,
|
|
|
+0x72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,
|
|
|
+0xFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,
|
|
|
+0x72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X67,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0XE2,0X3A,0XC6,0X00,0X00,0XA7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,
|
|
|
+0x00,0X1C,0X00,0X00,0X00,0X00,0XA8,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X03,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X5F,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,0X65,0X3A,0X00,0X00,0X01,0X81,0X70,0X3F,
|
|
|
+0x37,0X00,0X04,0X00,0X00,0X00,0X18,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XFE,0X1C,0X00,0X00,0X00,0X00,0XEE,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x3A,0XD7,0X07,0X00,0X00,0XFE,0X1C,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X01,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0X74,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XC4,0X96,0X94,0X5F,0X18,0X87,0X00,0X00,0X56,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,
|
|
|
+0x45,0X3A,0XD0,0XA4,0XB4,0X43,0X00,0X00,0X00,0X00,0X1D,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X43,0X32,0X50,0X3A,0X6E,0XD0,0XB9,0X43,0X00,0X00,0X00,0X00,0XD3,0X0D,
|
|
|
+0x50,0X42,0X5F,0X50,0X5F,0X4D,0X41,0X48,0X3A,0XD7,0X5F,0XAC,0X41,0X43,0X00,0X00,0X00,0X00,0X10,0X08,0X50,0X50,0X32,0X3A,0X40,0X93,0XF0,0X41,0X00,0X00,0X2E,0X08,
|
|
|
+0x50,0X50,0X31,0X3A,0XD7,0X5F,0XAC,0X41,0X00,0X00,0X1A,0X0D,0X50,0X43,0X41,0X50,0X5F,0X4D,0X41,0X48,0X3A,0XDC,0XD3,0X96,0X42,0X43,0X00,0X00,0X00,0X00,0X20,0X0C,
|
|
|
+0x50,0X54,0X50,0X34,0X30,0X35,0X36,0X3A,0XD7,0X5F,0XAC,0X41,0X18,0X00,0X38,0X0C,0X50,0X43,0X56,0X32,0X50,0X5F,0X49,0X4E,0X49,0X54,0X3A,0X00,0X00,0X00,0X44,0X0C,
|
|
|
+0x52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0XA7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,0X00,0X00,0X7B,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0XFB,0X9E,
|
|
|
+0xB4,0X43,0X00,0X00,0X00,0X00,0XA4,0X08,0X50,0X50,0X32,0X3A,0XEC,0X7B,0XF0,0X41,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,
|
|
|
+0x6E,0X74,0X3A,0X01,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X01,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X74,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XC4,0X96,0X94,0X5F,0X18,0X87,0X00,0X00,0XA7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,0X00,0X1C,0X00,0X00,
|
|
|
+0x00,0X00,0XDB,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0XD7,0X22,0XB4,0X43,0X00,0X00,0X00,0X00,0XA7,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X43,0X32,
|
|
|
+0x50,0X3A,0X02,0XC6,0XB9,0X43,0X00,0X00,0X00,0X00,0X7F,0X0D,0X50,0X42,0X5F,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X46,0X9C,0XAC,0X41,0X43,0X00,0X00,0X11,0X00,0XBD,0X0A,
|
|
|
+0x50,0X42,0X5F,0X4B,0X47,0X3A,0X00,0X00,0X00,0X00,0X9C,0XAC,0X00,0X00,0X2F,0X08,0X50,0X50,0X32,0X3A,0X10,0X2B,0XA7,0X41,0X00,0X00,0X74,0X08,0X50,0X50,0X31,0X3A,
|
|
|
+0x15,0X6D,0XA6,0X41,0X00,0X00,0X31,0X0D,0X50,0X43,0X41,0X50,0X5F,0X4D,0X41,0X48,0X3A,0XBD,0X08,0X97,0X42,0X43,0X00,0X00,0X00,0X00,0X66,0X0C,0X50,0X54,0X50,0X34,
|
|
|
+0x30,0X35,0X36,0X3A,0X15,0X6D,0XA6,0X41,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,0X00,0X00,0XC2,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X0F,0X61,0XCD,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,
|
|
|
+0xFF,0X94,0X96,0XC4,0X00,0X00,0XC2,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X0F,0X61,0XCD,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X04,0X00,0X04,0X12,0X73,0X74,0X61,0X72,0X74,0X54,0X69,0X6D,0X65,0X3A,0X00,0X00,0X01,0X81,0X70,0X76,
|
|
|
+0x25,0X80,0X00,0X00,0X00,0X00,0XA5,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X00,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0XC2,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X0F,0X61,0XCD,0X00,0X00,0XFE,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0X00,0X00,0X00,0X00,
|
|
|
+0x00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X18,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,
|
|
|
+0xD7,0X07,0X00,0X00,0XFE,0X1C,0X00,0X00,0X00,0X00,0XA6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X01,0X00,0X00,0X00,0X1C,0X00,0X00,0X00,0X00,0X74,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XC4,0X96,0X94,0X5F,0X18,0X87,0X00,0X00,0X02,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0X40,0XE1,
|
|
|
+0xB3,0X43,0X00,0X00,0X00,0X00,0XD1,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X43,0X32,0X50,0X3A,0X67,0X8B,0XB9,0X43,0X00,0X00,0X00,0X00,0XD9,0X0D,0X50,0X42,0X5F,0X50,
|
|
|
+0x5F,0X4D,0X41,0X48,0X3A,0X96,0XAC,0XA6,0X41,0X43,0X00,0X00,0X00,0X00,0XAD,0X08,0X50,0X50,0X32,0X3A,0X25,0X95,0XA6,0X41,0X00,0X00,0XAC,0X08,0X50,0X50,0X31,0X3A,
|
|
|
+0x25,0X95,0XA6,0X41,0X00,0X00,0X8B,0X0D,0X50,0X43,0X41,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X86,0X9A,0X96,0X42,0X43,0X00,0X00,0X00,0X00,0X9E,0X0C,0X50,0X54,0X50,0X34,
|
|
|
+0x30,0X35,0X36,0X3A,0X25,0X95,0XA6,0X41,0X00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0X73,0X10,0X43,0X5F,0X6D,0X61,
|
|
|
+0x63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,0XFF,0X94,0X96,0XC4,0X00,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,0X00,0X00,0X74,0X10,
|
|
|
+0x43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XC4,0X96,0X94,0X5F,0X18,0X87,0X0B,0X00,0X67,0X10,0X43,0X5F,0X6D,0X61,0X63,0X41,0X64,0X64,0X72,0X3A,0XFF,0XFF,
|
|
|
+0xFF,0XE2,0X3A,0XC6,0X05,0X00,0XE2,0X10,0X73,0X74,0X65,0X70,0X43,0X75,0X72,0X3A,0XD7,0X07,0X00,0X00,0XE0,0X04,0X00,0X00,0X06,0X00,0XB8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x3A,0XD7,0X07,0X00,0X00,0XE0,0X04,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XA7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X02,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XA8,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X03,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XA9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X04,0X00,0X00,0X00,0X04,0X00,0X00,0X0E,0X00,0X5B,0X0E,0X50,0X42,0X5F,0X42,0X52,0X5F,0X56,0X32,0X45,0X3A,0X60,0X02,0XCB,0X43,0X00,0X00,0X0F,0X00,0X9C,0X0E,
|
|
|
+0x50,0X42,0X5F,0X42,0X52,0X5F,0X43,0X32,0X50,0X3A,0X05,0XA0,0XD1,0X43,0X00,0X00,0X10,0X00,0X9B,0X0D,0X50,0X42,0X5F,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X1A,0XC6,0XC9,
|
|
|
+0x42,0X43,0X00,0X00,0X12,0X00,0XA7,0X08,0X50,0X50,0X32,0X3A,0XC9,0XDC,0XB4,0X42,0X13,0X00,0X06,0X08,0X50,0X50,0X31,0X3A,0X29,0XDC,0XB4,0X42,0X14,0X00,0X6E,0X0D,
|
|
|
+0x50,0X43,0X41,0X50,0X5F,0X4D,0X41,0X48,0X3A,0X9F,0X5B,0X9E,0X43,0X43,0X00,0X00,0X15,0X00,0XF8,0X0C,0X50,0X54,0X50,0X34,0X30,0X35,0X36,0X3A,0X29,0XDC,0XB4,0X42,
|
|
|
+0x00,0X00,0X44,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X00,0X00,0X00,0XAA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X05,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X1B,0X00,0X45,0X0C,0X52,0X65,0X73,0X74,0X61,0X72,0X74,0X43,0X6E,0X74,0X3A,0X01,0X00,0X00,0XAB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X06,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XAC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X07,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XAD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X08,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XAE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X09,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XAF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0A,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB0,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X0B,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0C,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XB2,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0D,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X0E,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X0F,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X10,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X11,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XB7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X12,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X13,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XB9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X14,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XBA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X15,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XBB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X16,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XBC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X17,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XBD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X18,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XBE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X19,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XBF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X1A,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC0,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X1B,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X1C,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XC2,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X1D,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X1E,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X1F,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X20,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X21,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XC7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X22,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X23,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XC9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X24,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XCA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X25,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XCB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X26,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XCC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X27,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XCD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X28,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XCE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X29,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XCF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X2A,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD0,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X2B,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X2C,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XD2,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X2D,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X2E,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X2F,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X30,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X31,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XD7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X32,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X33,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XD9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X34,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XDA,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X35,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XDB,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X36,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XDC,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X37,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XDD,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X38,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XDE,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X39,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XDF,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X3A,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE0,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X3B,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE1,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X3C,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+0x00,0X00,0XE2,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X3D,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE3,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,
|
|
|
+0x3A,0X3E,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE4,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X3F,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE5,0X0D,
|
|
|
+0x73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X40,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE6,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X41,0X00,0X00,
|
|
|
+0x00,0X04,0X00,0X00,0X00,0X00,0XE7,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X42,0X00,0X00,0X00,0X04,0X00,0X00,0X00,0X00,0XE8,0X0D,0X73,0X74,0X65,0X70,
|
|
|
+0x5F,0X6E,0X75,0X6D,0X3A,0X43,0X00,0X00,0X00,0X04,0X00,0X00,0X07,0X00,0XE9,0X0D,0X73,0X74,0X65,0X70,0X5F,0X6E,0X75,0X6D,0X3A,0X44,0X00,0X00,0X00,0X04,0X00,0X00,
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const uint8_t stepdata[] ={0x00,0X00,0X24,0XD5,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,
|
|
|
+0x00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0X00,0X00,0X0C,0XB7,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,};
|
|
|
+
|
|
|
+/****************************************************接口****************************************************/
|
|
|
+void Flash_Initialize(void)
|
|
|
+{
|
|
|
+ uint16_t i = 0;
|
|
|
+ uint8_t length =0;
|
|
|
+ minfds_init(&information);
|
|
|
+
|
|
|
+ //读取文件头
|
|
|
+ for(i =0;i<MAX_mflash_param_LENGTH;i++){
|
|
|
+ if(MINIFDS_SUCCESS == pm_get_length(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),&length)){
|
|
|
+ if(length == All_Falsh_value[i].length){
|
|
|
+ pm_find(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,&length);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ pm_delete(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name));
|
|
|
+ pm_add(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,All_Falsh_value[i].length);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ DEBUG_LOG("1111Flash head read(%04X).\n",mFlash.head);
|
|
|
+ if(mFlash.head !=FLASH_HEAD){ DEBUG_LOG("Flash first init(%04X),write infomation to flash.\n",mFlash.head);
|
|
|
+
|
|
|
+ Flash_DeleteAllInfor();
|
|
|
+ Flash_DeleteAllStep();
|
|
|
+
|
|
|
+ memset((uint8_t*)(&mFlash),0,sizeof(Flash_t));
|
|
|
+
|
|
|
+ uint32_t flash_data;
|
|
|
+
|
|
|
+// for(i =0;i< sizeof(oldflashdata)/4;i++){
|
|
|
+// flash_data = ((oldflashdata[i*4+3]<<24 & 0xff000000) | (oldflashdata[i*4+2]<<16 & 0x00ff0000) | (oldflashdata[i*4+1]<<8 & 0x0000ff00) | (oldflashdata[i*4] & 0x000000ff));
|
|
|
+// uint32_t err_code = sdflash_write((uint32_t*)(FLASH_START_ADDR_INFOR+i*4), &flash_data, 1);
|
|
|
+// DEBUG_LOG("sdflash_write is %d,%d,flash_data:%d\n",err_code,sizeof(oldflashdata)/4,flash_data);
|
|
|
+// }
|
|
|
+//
|
|
|
+// for(i =0;i< sizeof(stepdata)/4;i++){
|
|
|
+// flash_data = ((stepdata[i*4+3]<<24 & 0xff000000) | (stepdata[i*4+2]<<16 & 0x00ff0000) | (stepdata[i*4+1]<<8 & 0x0000ff00) | (stepdata[i*4] & 0x000000ff));
|
|
|
+// uint32_t err_code = sdflash_write((uint32_t*)(FLASH_END_ADDR_INFOR+i*4), &flash_data, 1);
|
|
|
+//// DEBUG_LOG("sdflash_write is %d,%d,flash_data:%d\n",err_code,sizeof(oldflashdata)/4,flash_data);
|
|
|
+// }
|
|
|
+
|
|
|
+ mFlash.head = FLASH_HEAD;
|
|
|
+ mFlash.isHost = _IS_HOST;
|
|
|
+
|
|
|
+ for(i =0;i<MAX_mflash_param_LENGTH;i++){
|
|
|
+ pm_add(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,All_Falsh_value[i].length);
|
|
|
+ }
|
|
|
+
|
|
|
+ mFlash.head =0;
|
|
|
+ for(i =0;i<MAX_mflash_param_LENGTH;i++){
|
|
|
+ if(MINIFDS_SUCCESS == pm_get_length(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),&length)){
|
|
|
+ if(length == All_Falsh_value[i].length)
|
|
|
+ {
|
|
|
+ pm_find(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,&length);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+//
|
|
|
+ DEBUG_LOG("Flash head second read(%04X).\n",mFlash.head);
|
|
|
+ if(mFlash.head != FLASH_HEAD){
|
|
|
+ DEBUG_LOG("Flash write head fail.\n");
|
|
|
+ Except_TxError(EXCEPT_FLASH,"Flash write head fail");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ DEBUG_LOG("System reset...\n",mFlash.head);
|
|
|
+ for(uint8_t i =0;i<6;i++){
|
|
|
+ nrf_delay_ms(500);
|
|
|
+ feed_watchdog();
|
|
|
+ }
|
|
|
+ NVIC_SystemReset();
|
|
|
+ }
|
|
|
+
|
|
|
+ DEBUG_LOG("err code :%s\n",mFlash.mFlashLog.logData);
|
|
|
+ DEBUG_LOG("Flash init ok.\n");
|
|
|
+
|
|
|
+ //TestHalFlashInterface();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 设置清空flash的标志
|
|
|
+ @param 无
|
|
|
+ @return 无
|
|
|
+*/
|
|
|
+static uint8_t FlashStep_ClearFlag =0;
|
|
|
+void flash_SetClearStepFlag(void){
|
|
|
+ FlashStep_ClearFlag =1;
|
|
|
+}
|
|
|
+
|
|
|
+uint32_t flash_GetStep_StartAddress(void){
|
|
|
+ return FLASH_START_ADDR_STEP;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 存储步数
|
|
|
+ @param 无
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t Flash_SaveStep(void)
|
|
|
+{
|
|
|
+ flash_OPER_Result err_code;
|
|
|
+ uint32_t flash_data;
|
|
|
+
|
|
|
+ #define Max_Hour PAGE_INT_SIZE * FLASH_ADDR_STEP_PAGENUM
|
|
|
+
|
|
|
+ if(mFlash.mStep.step_num < Max_Hour)
|
|
|
+ {
|
|
|
+// mFlash.mStep.stepCur[0] +=1 ;
|
|
|
+ uint32_t step = app_step_GetStep_L() + app_step_GetStep_R(); //获取左右鞋步数
|
|
|
+
|
|
|
+ flash_data = ((step<<24 & 0xff000000) | (step<<8 & 0x00ff0000) | (step>>8 & 0x0000ff00) | (step>>24 & 0x000000ff));
|
|
|
+
|
|
|
+ //清空步数的flash step内容
|
|
|
+ if(1 == FlashStep_ClearFlag){
|
|
|
+ if(Flash_DeleteAllStep() != ZONE_OP_SUCCESS){
|
|
|
+ Except_TxError(EXCEPT_DATEStep,"clear step fail");
|
|
|
+ return ZONE_ERROR_WRITE_FAIL;
|
|
|
+ }
|
|
|
+ mFlash.mStep.step_num = 0;
|
|
|
+ FlashStep_ClearFlag = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ DEBUG_LOG("step %d,flash_data:%d,step_num:%d\n",step, flash_data,mFlash.mStep.step_num);
|
|
|
+ err_code = sdflash_write((uint32_t*)(FLASH_START_ADDR_STEP + (mFlash.mStep.step_num * 4)), &flash_data, 1);
|
|
|
+ if(err_code != FLASH_OP_SUCCESS)return ZONE_ERROR_WRITE_FAIL;
|
|
|
+
|
|
|
+ mFlash.mStep.step_num++;
|
|
|
+ mFlash.mStep.step[0] = mFlash.mStep.stepCur[0];
|
|
|
+ mFlash.mStep.step[1] = mFlash.mStep.stepCur[1];
|
|
|
+
|
|
|
+ if(Flash_SaveInfomation() != ZONE_OP_SUCCESS){
|
|
|
+ Except_TxError(EXCEPT_FLASH,"save information fail");
|
|
|
+ }
|
|
|
+
|
|
|
+ uint8_t i=4;
|
|
|
+ uint8_t length =0;
|
|
|
+ for(;i<5;i++){
|
|
|
+ if(MINIFDS_SUCCESS == pm_get_length(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),&length)){
|
|
|
+ if(length == All_Falsh_value[i].length){
|
|
|
+ if(MINIFDS_SUCCESS == pm_find(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,&length))
|
|
|
+ {
|
|
|
+ DEBUG_LOG(">>>>>>>>%s value:%d\n",All_Falsh_value[i].name,mFlash.mStep.stepCur[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else return ZONE_ERROR_WRITE_FAIL;
|
|
|
+ return ZONE_OP_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 删除所有步数
|
|
|
+ @param 无
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t Flash_DeleteAllStep(void)
|
|
|
+{
|
|
|
+ uint32_t errcode = ZONE_OP_SUCCESS;
|
|
|
+ uint32_t pag_addr = 0;
|
|
|
+
|
|
|
+ for(uint8_t i=0;i<FLASH_ADDR_STEP_PAGENUM;i++){
|
|
|
+ pag_addr = (FLASH_START_ADDR_STEP +i*FLASH_PAGE_SIZE);
|
|
|
+ errcode = sdflash_page_erase(pag_addr);
|
|
|
+ if(errcode != NRF_SUCCESS)
|
|
|
+ return ZONE_ERROR_ERASE_FAIL;
|
|
|
+ }
|
|
|
+ return ZONE_OP_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 删除infromation的数据
|
|
|
+ @param 无
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t Flash_DeleteAllInfor(void)
|
|
|
+{
|
|
|
+ uint32_t errcode = ZONE_OP_SUCCESS;
|
|
|
+ uint32_t pag_addr = 0;
|
|
|
+
|
|
|
+ for(uint8_t i=0;i<FLASH_ADDR_INFOR_PAGENUM;i++){
|
|
|
+ pag_addr = (FLASH_START_ADDR_INFOR +i*FLASH_PAGE_SIZE);
|
|
|
+ errcode = sdflash_page_erase(pag_addr);
|
|
|
+ if(errcode != NRF_SUCCESS)
|
|
|
+ return ZONE_ERROR_ERASE_FAIL;
|
|
|
+ }
|
|
|
+ return ZONE_OP_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 读取一个区域中指定位置的数据
|
|
|
+ @param destination_addr[in] - 读取区域的地址
|
|
|
+ @param pData[in] - 指向存储的buff
|
|
|
+ @param dataLen[in] - 读取的长度,单位字节
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t flash_Data_Read(uint32_t addr, uint32_t *pData, uint32_t dataLen){
|
|
|
+ if(pData != NULL && dataLen != 0){
|
|
|
+ if(addr < START_FSTORAGE_ADDR || addr >= END_FSTORAGE_ADDR){
|
|
|
+ return ZONE_ERROR_ADDRESS_FAIL;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ memcpy(pData, (uint32_t*)addr, dataLen);
|
|
|
+ }
|
|
|
+ return ZONE_OP_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 存储基本信息
|
|
|
+ @param 无
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t Flash_SaveInfomation(void)
|
|
|
+{
|
|
|
+ char result =0;
|
|
|
+ for(uint8_t i =0;i<MAX_mflash_param_LENGTH;i++){
|
|
|
+ result = pm_update(&information,All_Falsh_value[i].name,strlen(All_Falsh_value[i].name),(uint8_t *)All_Falsh_value[i].value,All_Falsh_value[i].length);
|
|
|
+ if(result != MINIFDS_SUCCESS){
|
|
|
+ DEBUG_LOG("Flash_SaveInfomation fail name %s,result %d\r\n",All_Falsh_value[i].name,result);
|
|
|
+ return ZONE_ERROR_WRITE_FAIL;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ZONE_OP_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 保存日志信息
|
|
|
+ @param[in] id Fault identifier. See @ref NRF_FAULT_IDS.
|
|
|
+ @param[in] pc The program counter of the instruction that triggered the fault, or 0 if
|
|
|
+ unavailable.
|
|
|
+ @param[in] info Optional additional information regarding the fault. The value of the @p id
|
|
|
+ parameter dictates how to interpret this parameter. Refer to the documentation
|
|
|
+ for each fault identifier (@ref NRF_FAULT_IDS and @ref APP_ERROR_FAULT_IDS) for
|
|
|
+ details about interpreting @p info.
|
|
|
+ @return 错误代码
|
|
|
+*/
|
|
|
+uint32_t Flash_SaveLog(uint32_t id, uint32_t pc, uint32_t info)
|
|
|
+{
|
|
|
+ memset((uint8_t*)(&mFlash.mFlashLog),0,sizeof(FlashLog));
|
|
|
+ mFlash.mFlashLog.Errorflag =1;
|
|
|
+ switch (id)
|
|
|
+ {
|
|
|
+ #if defined(SOFTDEVICE_PRESENT) && SOFTDEVICE_PRESENT
|
|
|
+ case NRF_FAULT_ID_SD_ASSERT:
|
|
|
+ memcpy(mFlash.mFlashLog.logData,"SD: ASSERTION FAILED\r\n",MaxLength(sizeof("SD: ASSERTION FAILED\r\n"),sizeof(mFlash.mFlashLog.logData)));
|
|
|
+ break;
|
|
|
+ case NRF_FAULT_ID_APP_MEMACC:
|
|
|
+ memcpy(mFlash.mFlashLog.logData,"SD: INVALID MEMORY ACCESS\r\n",MaxLength(sizeof("SD: INVALID MEMORY ACCESS\r\n"),sizeof(mFlash.mFlashLog.logData)));
|
|
|
+ break;
|
|
|
+ #endif
|
|
|
+ case NRF_FAULT_ID_SDK_ASSERT:
|
|
|
+ {
|
|
|
+ assert_info_t * p_info = (assert_info_t *)info;
|
|
|
+ sprintf((char *)mFlash.mFlashLog.logData,"ASSERTION FAILED %s:%u\r\n",
|
|
|
+ p_info->p_file_name,
|
|
|
+ p_info->line_num);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case NRF_FAULT_ID_SDK_ERROR:
|
|
|
+ {
|
|
|
+ error_info_t * p_info = (error_info_t *)info;
|
|
|
+
|
|
|
+ sprintf((char *)mFlash.mFlashLog.logData,"error:%u,%s:%u\r\n",
|
|
|
+ p_info->err_code,
|
|
|
+ p_info->p_file_name,
|
|
|
+ p_info->line_num);
|
|
|
+ DEBUG_LOG(">>>>>err code :%d,%s",p_info->err_code,mFlash.mFlashLog.logData);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ sprintf((char *)mFlash.mFlashLog.logData,"UNKNOWN FAULT 0x%08X\n", pc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return Flash_SaveInfomation();
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ @brief 测试halflash接口
|
|
|
+ @param 无
|
|
|
+ @return 无
|
|
|
+*/
|
|
|
+void TestHalFlashInterface(void)
|
|
|
+{
|
|
|
+
|
|
|
+// uint2_t i;
|
|
|
+// Flash_t m_testflash;
|
|
|
+// FlashBackup_t m_testbackup;
|
|
|
+
|
|
|
+// //测试基本信息和备份信息的写入和读取
|
|
|
+// for(i=0;i<10000;i++)
|
|
|
+// {
|
|
|
+// mFlash.mStep.step_num = i;
|
|
|
+// DEBUG_LOG("Flash_SaveInfomation[%d]:%d \n",i,Flash_SaveInfomation());
|
|
|
+//
|
|
|
+// DEBUG_LOG("Flash_SaveBackup[%d]:%d \n",i,Flash_SaveBackup());
|
|
|
+// }
|
|
|
+//
|
|
|
+// DEBUG_LOG("Flash_GetInfomation[%d]:%d \n",i,Flash_GetInfomation(&m_testflash));
|
|
|
+// DEBUG_LOG("m_testflash:%d \n",m_testflash.mStep.num);
|
|
|
+//
|
|
|
+// DEBUG_LOG("Flash_GetBackup[%d]:%d \n",i,Flash_GetBackup(&m_testbackup));
|
|
|
+// DEBUG_LOG("m_testbackup:%d \n",m_testbackup.hardVersion);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|