本帖最后由 niuyaliang 于 2014-4-26 07:49 编辑
代码如下面所示、
TempData[u8j]为定义的一个数组
uint8_t TempData[] = {"9600"};
MenuDataSet为指针数组
uint8_t *MenuDataSet[3] ={
"NO-000",//43
"9600bps",//44
"0000-0000000", //45
};
uLen = GetLenStr(&MenuDataSet[u8i][0]);//找到指针数组的大小
for(u8j=0;u8j<uLen;u8j++)//复制字符串数组到临时的数组
{
*(MenuDataSet[u8i]+u8j) = TempData[u8j];
}
运行时进入硬件错误
HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
IF SEMIHOSTED
LDR R0, [R13, #24] ; Get previous PC
LDRH R1, [R0] ; Get instruction
LDR R2, =0xBEAB ; The sepcial BKPT instruction
CMP R1, R2 ; Test if the instruction at previous PC is BKPT
BNE HardFault_Handler_Ret ; Not BKPT
ADDS R0, #4 ; Skip BKPT and next line
STR R0, [R13, #24] ; Save previous PC
BX LR
HardFault_Handler_Ret
ENDIF
B
|