960 views
in System Integration by

Hi there,

in my Build directory i have a myCode.c and myCode.h . myCode.h defines void YourDevice_SayHello();. I changed the Makefile to include the myCode.c file.

Now i added a Button to my GUI that calls a Slot method in Device.mySlot(). All that contains is a call to YourDevice_SayHello();. Of course it is enclosed in !$prototyper and native(){} blocks.

I also added a Inline block with one line: #include "myCode.h"

After building and transferring my project to the target devices (Raspberry Pi) and running make, i get warnings about this:

Compiling ./GeneratedCode/Views.c
Compiling ./GeneratedCode/Application.c
./GeneratedCode/Application.c: In function ‘ApplicationDeviceClass_mySlot’:
./GeneratedCode/Application.c:1037:5: warning: implicit declaration of function ‘YourDevice_SayHello’ [-Wimplicit-function-declaration]
     YourDevice_SayHello();
     ^
In file included from ./GeneratedCode/Application.c:1087:0:
./myCode.h: At top level:
./myCode.h:3:6: warning: conflicting types for ‘YourDevice_SayHello’
 void YourDevice_SayHello();
      ^
./GeneratedCode/Application.c:1037:5: note: previous implicit declaration of ‘YourDevice_SayHello’ was here
     YourDevice_SayHello();
     ^
Compiling ./GeneratedCode/Templates.c
Compiling ./GeneratedCode/Flat.c

So how to i properly add my header file so that GUI and also custom code is aware of my function definitions?

All that said - the code itself works. The application compiles and correctly outputs "Hello" each time i press the GUI button, so i am presuming all i have to do is to find out where to add my #include myCode.h

 

Thanks!

1 Answer

0 votes
by
 
Best answer
In the EW application, i moved the Inline block lower than the Device/DeviceClass blocks. This seems to have solved my issue. I presume the Code Generator will then process the Inline statement (defining function) before the Device/DeviceClass (calling function).
by

Hello,

Exactly. The order in which the members are numbered in Inspector window does correspond to the order in which the members are converted in code. Please see:

Inline member: Determine the position in the generated code.

Inspector: Reorder members.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...