HCS12 weak attribute

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

HCS12 weak attribute

1,779 次查看
MM158
Contributor I

Hello,

I'm working with HCS12 in CodeWarrior 5.9.0, and i try to use "weak" function attribute.

I don't find any clear statement (or example) on HCS12, that this attribute is available or not.

 

If there is not, can you help me how can I find an alternative for it.

Can you help me on this subject?

Thanks in advance.

0 项奖励
回复
4 回复数

1,747 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

I am very sorry, I was informed from responsible department,  I was asking, this is an internal and confidential information.

Best regards,

Ladislav

0 项奖励
回复

1,747 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

 

I am not absolutely sure I understand but it leads me to conditional compilation.  ifdef ifndef

 

Best regards,

Ladislav

0 项奖励
回复

1,760 次查看
stanish
NXP Employee
NXP Employee

Hello,

I'm affraid that weak attribute is not supported by HCs12 Compiler/Linker. Could you possibly describe the issue you are trying to solve by using weak attribute? Perhaprs there might be some wokaround to achieve a similar link behavior.

Regards,

Stan

0 项奖励
回复

1,755 次查看
MM158
Contributor I

Hello again,

Thank you for your answer @stanish,

I want to test a function (e.g. source.c) and mock (by cmock) one of the functions that are called in source.c .

now I have two function with similar name (i.e. original version of function and its fake or mock), 

in my test file (test.c) I want to weak the original version of function and use its mock. 

how can I do this?

 

example:

/* source.c */

int func_1 (void)

{

    int x = 1;

    int y = 12;

    int z = func_call_1 (x,y);

    return z;

}

-----------------------------------------------------------------------

/* func_2.c */

int func_call_1(int x, int y)

{

   //do somthing

}

-----------------------------------------------------------------------

now in my mock file I have also a fake function with the name of func_call_1,

how I can run func_call_1 in my mock and not in func_2.c ?

in a normal situation weak attribute could did it.

0 项奖励
回复