主题中讨论的其他器件:C2000WARE
大家好、
我需要有关下面查询的帮助。
客户 在刷写 CPU1时发现一个奇怪的问题。
下面是一段代码:
static float offset = 30.0f;
static const Radians steps[6] = {
from_degrees(offset + 0.f),
from_degrees(offset + 60.f),
from_degrees(offset + 120.f),
from_degrees(offset + 180.f),
from_degrees(offset + 240.f),
from_degrees(offset + 300.f),
};
static const Radians table[8] = {
/* 0 0 0 */ -1,
/* 0 0 1 */ steps[1], // II
/* 0 1 0 */ steps[3], // IV
/* 0 1 1 */ steps[2], // III
/* 1 0 0 */ steps[5], // VI
/* 1 0 1 */ steps[0], // I
/* 1 1 0 */ steps[4], // V
/* 1 1 1 */ -1,
};
在调试时、他们看到该表没有正确的值:

在 CPU1.map 中 可以看到该表存储在.const 中、但步骤位于 BSS 中:
00090c1c 00000010 HALL.obj (.const:table$9)
.bss 0 0000b800 000006e9 未初始化
0000b800 000003e6 system.obj (.bss)
0000bbe6 0000000c hall.obj (.bss:Steps$9)
在 RAM.cmd 中、const 被定义为.const:> RAMGS3 | RAMGS4 | RAMGS5、但在 flash.cmd 中它不存在
静态内联浮点 from_degates (float deges){
返回度数* M_PI / 180.0f;
}
这可能是一个错误吗?
提前感谢您。
此致、
Marvin 酒店