Why does ADC component create undefined functions?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why does ADC component create undefined functions?

1,355 Views
asfarley
Contributor IV

The PE-generated code for a Kinetis ADC component generates the following code:

#define AD2_SAMPLE_GROUP_SIZE 13U
static void AD2_MainMeasure(void);

When I compile, I get a warning:
warning: 'AD2_MainMeasure' declared 'static' but never defined [-Wunused-function]

Is there any particular reason this component produces an undefined function? I think this is a bug.

Edit: I have attached a minimal project to reproduce this issue.

0 Kudos
10 Replies

1,069 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Alexander Farley,

Please share your project, I will check it on my side.

BR

Alice

0 Kudos

1,069 Views
asfarley
Contributor IV

Hi Alice

Just following up, any idea about those ADC warnings? I'd like to get down to zero compiler warnings, and this is one of the remaining items. 

0 Kudos

1,069 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

   Hello Alex,

I'm very sorry , we are restricted into google drive in your company,  I have asked the our IT, there is no method to access it . So could you please attached your project in the community as below steps:

Edit -> Attach:

pastedImage_1.png

pastedImage_3.png

BR

Alice

0 Kudos

1,069 Views
asfarley
Contributor IV

Hi Alice 

I've updated the Google Drink link to ensure that it's publicly accessible:

ADC example.zip - Google Drive 

I think you should be able to access it now. 

I've also attached the project directly to this thread. Thanks,

Alex

0 Kudos

1,069 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Alexander,

Which version of IDE do you used ? There are a lot of error when I build .

0 Kudos

1,070 Views
asfarley
Contributor IV

I'm using KDS 3.2. 

What errors are you seeing? I've installed some Processor Expert external packages (although the components in question are distributed by Kinetis, and I thought I removed all the external Processor Expert components for this example).

0 Kudos

1,070 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Alex,

A function add "static" can only used in the definition source file , can't  detected  on other files.

So there is warning that in AD1.h and AD2.h.

And I was just wondering , why statement it in header files? Do you want to use it in other files?

If yes, please delete "static".


Have a great day,
TIC

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

0 Kudos

1,070 Views
asfarley
Contributor IV

Alice: I did not write that code. It's generated by Processor Expert.

I fully understand how 'static' is meant to be used. The problem is that whoever wrote this PE component at NXP does not understand how to use static. So, I say to you: please delete "static". 

0 Kudos

1,070 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Alex,

Sorry for the inconvenient to you .

we can only delete it by hand, after finish configuration of the ADC component ,  enable "Don't Write Gnerated Component Modules", the generated code won't changed.

pastedImage_1.png


Have a great day,
TIC

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

1,070 Views
asfarley
Contributor IV

Hello Alice

Here's a link to a reduced version of our project, which only contains the ADC Processor Expert component. I have confirmed that this project builds and reproduces the issue (ADC compiler warnings about an undefined function). 

https://drive.google.com/open?id=1mEnwL3PLpCC37Ws7FDzEbFVV-WJKPqVZ 

Please let me know if you need anything else.

Thanks ,

Alex

0 Kudos