New component API?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi guys,

   

I'm trying to design new component but I don't compile simple project because of some warnings regarding definitions. Could you look at the attachement? Robert

0 Likes
9 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You did not #include your generated .h files where needed. And the begin of your .h do not have the #ifndef xxx #define xxx pattern as usual in C language.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

It doesn't matter. The problem is with definitions like this: #define RESET_WRX `$INSTANCE_NAME`_WRX_Write(0)

   

Robert

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Attached...

0 Likes
Anonymous
Not applicable

Sorry Bob, you are right that I should add all the *.h files where they are needed but I don't want to do it. I want to design new component where all should be done automatically without adding anything manually. Just drag and drop your component, compile project and so on... Could you give me some tips how to change it? R

0 Likes
Anonymous
Not applicable

Maybe the solution is to include all the *.h files that will be generated (for all component pins) to the *.c file of component API like this:

   

#include "`$INSTANCE_NAME`_CSX.h"
#include "`$INSTANCE_NAME`_RDX.h"
#include "`$INSTANCE_NAME`_WRX.h"
#include "`$INSTANCE_NAME`_DCX.h"
#include "`$INSTANCE_NAME`_RESX.h"
#include "`$INSTANCE_NAME`_DATA.h"

   

Robert

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, that way it is correct.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

But maybe there is a better way to design component API? R

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You probably already red the "Component Author Guide", there is no other way to create a component.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

robiw,

   

I believe that using a customizer written in Microsoft Studio you can fill-in any *.h, *.c, *.v files with custom code. This is a lot of work! Conditional compilation is an easier alternative. 

0 Likes