create library function

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

create library function

1,287 次查看
guochunhua
Contributor II

Hi.

Excuse me, My MCU is 56f84789, and my version is codewarrior 10.7, how do I create library functions in codewarrior 10.7? and how can I call my library functions ?can you tell me in detail? thank you very much.

Best regards.

Chuhua guo

0 项奖励
回复
4 回复数

1,102 次查看
guochunhua
Contributor II

Hi Jennie

I have created a lib project, and wrote my lib file as follows

1.png

but there has no header file, I can not declare it in header file(.h), how can I do ? can you give me a video which  show me how to create  library functions and how to call it? thank you very much.

Best regards.

Chunhua Guo

0 项奖励
回复

1,102 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Chunhua,

Attached is the video and demo code I made.

Hope this helps.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,102 次查看
BlackNight
NXP Employee
NXP Employee

Not a video, but something to read: A Library with ARM gcc and Eclipse | MCU on Eclipse 

Same principle applies for DSC too.

I hope this helps,

Erich

0 项奖励
回复

1,102 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Chuhua,

1. In CW 10.7, we can create library with wizard, just select "library" for project type.

pastedImage_1.png

2. after creating the lib project, write your functions in source code and also declare it in header file (.h)

3. copy the generated .lib and .h to user project folder.

4. add the lib path to user project "properties", "settings", "DSC Linker", "input", "Additional Libraries"

Please follow above steps and see how it works.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复