add file to MQX project issue

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

add file to MQX project issue

Jump to solution
908 Views
miniwang
Contributor III

Hi,

I created a empty MQX project, there are 2 files created - main.c and main.h.

I wrote a sample function(control GPIO) in main.c, it's OK for compile ,download and debug.

But when I try to move the function to another file(ex: IO.c, IO.h) to organize the code, there are thousand error occured.

(undefined identifier '_mqx_uint'  , identifier expected  , illegal function definition..........etc.)

Is there any setting should I do when I add other file to MQX project?

the environment : CodeWorrior 10.2  &  MQX 3.8.1

Thank you in advance.

Mini


Tags (3)
0 Kudos
1 Solution
499 Views
Martin_
NXP Employee
NXP Employee

in your .c file you should include at least mqx.h and bsp.h:

#include <mqx.h>

#include <bsp.h>

View solution in original post

0 Kudos
4 Replies
500 Views
Martin_
NXP Employee
NXP Employee

in your .c file you should include at least mqx.h and bsp.h:

#include <mqx.h>

#include <bsp.h>

0 Kudos
499 Views
miniwang
Contributor III

Martin, thanks for your reply.

it's already include those header file in my .c file.

Mini

0 Kudos
499 Views
Martin_
NXP Employee
NXP Employee

_mqx_unit typedef is in the header file psptypes.h.

psptypes.h is inclucded into your project via bsp.h, which includes psp.h, which includes psptypes.h

It seems the compiler can't find the psp header files in your project.

So you should double check all your compiler include paths - it seems the psp header files are not included. Compiler settings are specific to a project.

499 Views
miniwang
Contributor III

Thanks a lot, Martin.

This issued have be solved.

The solution is add #include "main.h" in IO.c file. mqx.h and bsp.h are included in main.h.

I'm curious that I've already include mqx.h and bsp.h in IO.c, why I still need to include main.h?

Anyway, thanks for your help.