我想把一个字节数组指针转换成以下结构:
TyBuffsStult{
UIT1616T数据1;
UIT1616T DATA2;
UIT1616T数据3;
U
ti1616T数据4;
UIT88T数据5;
BuleRevisValueSut;
我这样做:
无效函数(UTI8*T*缓冲器){
BeleRevsValueSt**值;
值=(BuleReVESeValueSt**)和缓冲器〔1〕;
函数2(值-gt;DATA1);
}
在调试时,一切看起来都很好,但是当我进入函数2时,程序跳转到StuttuppPoSoC63YMCMPLUS S中的故障处理程序。
有没有人理解这为什么不起作用?
以上来自于百度翻译
以下为原文
I want to cast a byte array pointer to the following structure:
typedef struct {
uint16_t data1;
uint16_t data2;
uint16_t data3;
uint16_t data4;
uint8_t data5;
} BleServicesValues_t;
I do something like this:
void func1(uint8_t* buffer) {
BleServicesValues_t* values;
values = (BleServicesValues_t*) &buffer[1];
func2(values->data1);
}
While debugging, everything looks fine, but when I step into func2, the program jumps to Fault_Handler in startup_psoc63_cm0plus.S.
Does anyone understand why this is not working?