Locating where a macro or function is defined/included

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

Locating where a macro or function is defined/included

跳至解决方案
1,341 次查看
davepfaltzgraff
Senior Contributor I

I am moving a project from KSDK to MCUXpresso. The original design was done over 6 years ago and now it is being expanded to implement previously unused I/O. So, it was thought that this was the best time to convert over to MCUXpresso for continuing support. The problem I'm having is in determining which functionality to bring in from the SDK Components. Is there some form of reference that would give me direction as compared to just poking in the dark?

For example, right now I am trying to implement the USB Device CDC functionality. In looking at the code generated, I see that the macro USB_DEVICE_CONFIG_CDC_ACM needs to be defined to pull in what I need. However, I am unable to locate where that should be defined.

Another example is that my 'old' code has several functions that don't appear in the newly generated code. Again, help in locating these would be helpful. Of course, it may be that if I can get all the macros defined correctly, this one may go away.

Thanks for any pointers...

0 项奖励
回复
1 解答
1,299 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I reviewed the example and the usb_device_config.h is created by the user, the document has only the #define´s to config the USB, which does not appear on your custom project, I suggest copying the file to your project and activating the macros that you need.

Best regards,
Pavel

 

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,331 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, if you want to know the root of a macro you could use CTRL + click on the macro, otherwise with the mouse on the macro, right-click and select toggle source.

Pavel_Hernandez_0-1709607629368.png

if you want to find a function, on the window Outline you could find all the functions on the .h or c depending on the document that you are.

Pavel_Hernandez_1-1709607727622.png

Let me know if you have more questions.

Best regards,
Pavel

 

 

 

0 项奖励
回复
1,323 次查看
davepfaltzgraff
Senior Contributor I

Hi Pavel,

Thanks for the pointer. It did help me some and I'm sure it will be useful in the future, but I don't think I asked the right question. For example, using the <ctrl>click approach, I did locate the code:

/*! @brief CDC ACM instance count */
#ifndef USB_DEVICE_CONFIG_CDC_ACM
#define USB_DEVICE_CONFIG_CDC_ACM (0U)
#endif

in the usb_device_config.h file.

However, my question should have been: Where in the "Manage SDK Components" menu system can I turn this on? In the "Middleware->USB" section, I did select "USB Device->USB Device CDC" and noted that other selections became active. But the code I was looking for is still not active as USB_DEVICE_CONFIG_CDC_ACM now has a value of 0.

I am trying my best to work within the framework that MCUXpresso provides and have all of my edits in the "source" directory. It's all part of the learning process.

Thanks, Dave

0 项奖励
回复
1,314 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I understand but is not enough to offer a solution, because this is a custom project. Could you review some of the USB examples to try to find the macro that you need when you have the name of the example could you tell me?

Best regards,
Pavel

0 项奖励
回复
1,306 次查看
davepfaltzgraff
Senior Contributor I

Hi Pavel,

Following your suggestion, I found the example at ...\frdmk22f\dev_cdc_vcom_freertos

However, the selection combination I see in the "Manage SDK Components" section does not make sense initially. I will need to pursue it.

In looking at the pin configuration, it would appear that there's not much there.

Back to the program!

Thanks, Dave

0 项奖励
回复
1,300 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I reviewed the example and the usb_device_config.h is created by the user, the document has only the #define´s to config the USB, which does not appear on your custom project, I suggest copying the file to your project and activating the macros that you need.

Best regards,
Pavel

 

0 项奖励
回复
1,296 次查看
davepfaltzgraff
Senior Contributor I

Hi Pavel,

That pointer along with the example will go a long ways in finding my solution.

During this pursuit, I see much similarity and yet many differences between the KDS implementation and that of MCUXpresso. Understandable, but it will take me a while to work my way through it all.

Thanks for your help, Dave

0 项奖励
回复