int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
Green Deng:你好,看程序没看出来有什么问题。使用的具体是哪个例程?出错点在哪里,可以用单步运行测试一下?count和countk可能的值是多少?
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
兵家墨梅:
回复 Green Deng:
count然后会累加,count值最大199,countk最大也为199。程序块以通过仿真验证过,count和countk不会超过数组边界,单步运行也没啥问题。
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
兵家墨梅:
回复 Green Deng:
另外,结构体分配内存的时候,也有一些疑惑,
U数组设置为200的时候,map中相关变量地址如下:
Re_A为包含U数组的结构体变量,内含有除去U外9个float型变量,U设为200时,共计209,Re_A、Re_C、Re_B为相同结构体变量
addressdatapagename
0000bc802f2 (0000bc80)_Re_A
0000be402f9 (0000be40)_Re_C
0000c000300 (0000c000)_Re_B
bc80-be40=1c0(448)
float变量个数为:448/4=112
为啥不是209?或212(4的整数倍)
仅改变U数组的维数,维数设置为400
0000cb8032e (0000cb80)_Re_CurrentA
0000cec033b (0000cec0)_Re_CurrentC
0000d200348 (0000d200)_Re_CurrentB
仅改变U数组的维数,维数设置为600
0000cb8032e (0000cb80)_Re_CurrentA
0000d080342 (0000d080)_Re_CurrentC
0000d580356 (0000d580)_Re_CurrentB
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
Green Deng:
回复 兵家墨梅:
抱歉暂时无法解决你的问题,我将问题发送到了英文E2E论坛了,你可以跟帖咨询一下:
e2e.ti.com/…/2958313
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
兵家墨梅:
回复 Green Deng:
太感谢了,亲
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 200;
b = temp1 – 100;
if (b < 0)
b += 200;
c = temp1 – 100 – 1;
if (c < 0)
c += 200;
int temp2 = countk;
int a = 0;
int b = 0;
int c = 0;
if (a < 0)
a += 400;
b = temp1 – 200;
if (b < 0)
b += 400;
c = temp1 – 200 – 1;
if (c < 0)
c += 400;
Green Deng:
回复 兵家墨梅:
你客气了,很遗憾没能帮你解决问题。祝你后期调试顺利
TI中文支持网





