how can MSL_Common codes are included in my project?

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

how can MSL_Common codes are included in my project?

1,932 Views
kyk27
Contributor I
Hello, I'm a very novice for CodeWarrior.
 
I want to use clock_t variable in time.h in MSL_Common header file.
I included #include <time.h>, but CodeWarrior doesn't recognize the variable.
How can I add the header file for my project?
 
I currently use MPC5200B, and CodeWarrior studio for mobileGT v8.5.
 
Thanks for your time.
 
kyk27

Message Edited by kyk27 on 2007-02-2101:19 AM

Labels (1)
0 Kudos
Reply
3 Replies

700 Views
kyk27
Contributor I
Thank you, CrasyCat, very much for your answer.
Yes, could you show me how I create a stub version of library?
I really appreciate your help.
 
kyk27
0 Kudos
Reply

700 Views
CrasyCat
Specialist III
Hello
 
OK I would do that in the following way:
  - In an explorer window browse to {Install}\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Project
  . duplicate MSL_C.PPCEABI.stub.mcp and give it an appropriate name (for instance MyStubLib.mcp).
  - Go to {Install}\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Include and duplicate the file
    PREFIX_EPPC_STUB.h and give it an appropriate name (for example PREFIX_EPPC_MYSTUB.h)
  - Open the new project you have created (in our example  MyStubLib.mcp).
  - For each of the build target (library) specify you want to use you new  prefix file 
   (PREFIX_EPPC_MYSTUB.h in our example). To do that
       - Open the target setting dialog (Hitting ALT+F7)
       - Switch to "C/C++ Preprocessor"
       - Replace #include "PREFIX_EPPC_STUB.h" with #include "PREFIX_EPPC_MYSTUB.h"
  - You may also change the name of the generated library if you wish. This is defined in the
    "EPPC Target" Panel.
  - Edit the file PREFIX_EPPC_STUB.h. Make sure _MSL_OS_TIME_SUPPORT,    
    _MSL_CLOCK_T_AVAILABLE and _MSL_TIME_T_AVAILABLE are set to 1.
  - Open the file  time.stub.c (this file is present in the .mcp window in folder "OS Dependant")
  - Include your implementation of __get_clock, __get_time,__to_gm_time in there
  - Build the library
 
  Make sure to use the stub library you just created rather than the MSL_C.PPCEABI library
  in your project.
 
That should do it.
 

CrasyCat
0 Kudos
Reply

700 Views
CrasyCat
Specialist III
Hello
 
Standard library delivered with CdeWarrior for MPC does not include support for time functions or file IO.
These functions are based on low level functions from the platform hardware or operating system providing information on time of day or return an internal clock tick.
 
Please refer to "{Install}\Help\PDF\MSL C Reference.pdf" chapter "Configuring MSL C" section "Configuring Time and Clock" for more information around that.
 
In my opinion you need to create a stub version of the library, where you enable time and clock function support.
 
Do you need information on how to do that?
 
CrasyCat
0 Kudos
Reply