keil如何设置overlay,避免局部变量覆盖.新手求助!!!
keil用变量覆盖的方法,分配局部变量.
我用SMALL RTOS51 写任务时,它会把我任务的局部变量分配到同一个内存中,程序就错了
在OVERLAY里边设置,可以分配在不同的空间,可是我不懂怎么设置!
有4个任务,LED0到LED3
为了防止keil使局部变量覆盖,设置overlay仿照例子,我填入的内容是main~LED1,main~LED2,main~LED3
程序是实时运行起来了,但是不知道上面填入的内容是什么意思.
英文有点差,下面是关于overlay的介绍
Removing Call References Between Segments
OVERLAY (sfname-caller ~ sfname-callee)
OVERLAY (sfname-caller ~ (sfname-callee, sfname-callee))
This form of the OVERLAY directive specifies that references from sfname-caller to sfname-callee are to be removed from overlay analysis.
Function references are automatically added to overlay analysis when you reference one function inside another (typically, these references are function calls). If you reference the address of a function (without calling the function), the linker considers this to be a reference between the two functions and it is included in overlay analysis. You may remove this reference manually using this form of the OVERLAY directive.
Referring to the following overlay map:
SEGMENT DATA_GROUP
+--> CALLED SEGMENT START LENGTH
----------------------------------------------
?PR?_FUNC?DMAIN ----- -----
+--> ?PR?_FUNC_A?DMAIN
+--> ?PR?_FUNC_B?DMAIN
You may remove the references from ?PR?_FUNC?DMAIN to ?PR?_FUNC_A?DMAIN and ?PR?_FUNC_B?DMAIN with the following OVERLAY command:
OVERLAY(?PR?_FUNC?DMAIN ~ (?PR?_FUNC_A?DMAIN,?PR?_FUNC_B?DMAIN))