uV4 优化选择LEVEL 0的时候程序完全正常,选择LEVEL 1-3 编译没有报错,但都不能正常运行
void address_set(volatile uint16_t x1,volatile uint16_t y1,volatile uint16_t x2,volatile uint16_t y2)
{
//address_start(x1,y1);
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0020;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = x1;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0021;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = y1;
//address_point(x1,y1,x2,y2);
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0050;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = x1;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0051;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = x2;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0052;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = y1;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0053;
*(u16 *) (Bank1_SRAM1_ADDR + 0x00020000) = y2;
//Write_COM(0x0022); //Write Data to GRAM
*(u16 *) (Bank1_SRAM1_ADDR + 0x00000000) = 0x0022;
}
优化后这部分只执行了第一句 就跳过了, 变量X1,X2都显示out of scope
有人知道原因吗 ? 或者怎么设置可以不对这部分代码优化? |