signed long long MinusResult[DefineMinusGetResultCount];
unsigned long TestTime1Vaule1;
unsigned long TestTimer2Vaule3;
unsigned long TestTime1Vaule2;
unsigned long TestTime1SetVale;
unsigned char TestHaveSetTime1Flag;//是否已经得到了时间值
unsigned char HighOrLowFlag;//1 就是 实际中断时的值>要设置的数值,0就是<
unsigned char HaveSetTimer1Flag;//1就是已经设置了时间值,目前程序只设置一次
unsigned char GetResultCount;//已经得到了几次 如果==DefineMinusGetResultCount
} _TestDisplayTimer1Struc;
_TestDisplayTimer1Struc TestDisplayTimer1Struc;
when use th function Temp1=SignedGetMeanValue((signed long long*)&(TestDisplayTimer1Struc.MinusResult),DefineMinusGetResultCount);
signed long long SignedGetMeanValue(signed long long * ValueArray,unsigned short int Length) thsi is th protype
the EWARM iar give the warn: use of address of unaligned structure member
how can i reslove the wran:::???
use this math:
unsigned long long ppp[DefineMinusGetResultCount];
for(unsigned int kknd=0;kknd<DefineMinusGetResultCount;kknd++)
{
ppp[kknd]=TestDisplayTimer1Struc.MinusResult[kknd];
}
//Temp1=SignedGetMeanValue((signed long long*)&(TestDisplayTimer1Struc.MinusResult),DefineMinusGetResultCount);
Temp1=SignedGetMeanValue((signed long long*)&(ppp[0]),DefineMinusGetResultCount);
just use a the temp var
#pragma pack(1) typedef struct { signed long long MinusResult[DefineMinusGetResultCount]; unsigned long TestTime1Vaule1; unsigned long TestTimer2Vaule3; unsigned long
C++ 语言结构体 (
structure
- struct)
Arrays are
use
d to store similar type of data.
数组用于存储相似类型的数据,但是 struct 是 C++ 中用户自定义的可用数据类型,允许存储不同类型的数据项。
We
use
structure
s to store different types of data. For example, you are a student. Your name is a string and your phone
今天YD在移植告警模块时遇到一个很稀罕的warning,google+baidu也没有找到结果。
warning描述如下: Warning[Pa039]:
use
of
address
of
unaligned
structure
member
......
对应的程序为: lstInit(&(gCurAlarmList.currentAlarmTable));
最近在用IAR开发MSP430程序过程中发现了一个问题,具体描述是这样的
首先定义了一个struct并强制1个字节对齐#pragma pack(push) //保存对齐状态
#pragma pack(1)//设定为4字节对齐
typedef struct
uint8_t fix_mode;
uint32_t latitude; //纬度 分扩大100000倍,实际要除以1000
最近调试st7162,在运行中偶然出现死机现象,报
Unaligned
use
rspace access in "xxx.exe" pid=1247 pc=0x0041e80c ins=0x2c02
该问题主要是第三方库和自己的编译选项不一致造成的,统一编译选项就可以解决这类问题,主要有关系的编译选项有:-O2 -Wno-deprecated
HOLD_JLU:
TIM_OCMode_PWM2;TIM_OCMode_PWM1
The hopes of the whole village:
两种TL431的恒流源电路 分析
chunwen07: