CHAILink SDK  Version 1.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CLCm_Platform.h
Go to the documentation of this file.
1 // Release Date: 2014/04/15
2 //*********************************************************
3 // This file has to be customized per platform, and defines
4 // various basic macro/function :
5 // CLC_SDK_API : this macro enables to define export
6 // for instance when using CHAILink in a
7 // dynamic library.
8 // default is : #define CLC_SDK_API
9 // CLCmemset : must work as standard C-runtime memset function.
10 // CLCmemcpy : must work as standard C-runtime memcpy function.
11 // CLCstrlen : must work as standard C-runtime strlen function.
12 // CLCGetTick : must have the following prototype:
13 // CPUINT32 CLCGetTick(void);
14 // This macro/function must return a system time
15 // expressed in millisecond (unsigned 32 bit word).
16 // CLCPLATFORM_LOCK / CLCPLATFORM_RELEASE : These macro can be
17 // used to implement a lock/Unlock mechanism on
18 // multi-threaded platform. Default definition is
19 // empty.
20 // CLCPLATFORM_WAITFOREVENT / CLCPLATFORM_SIGNALEVENT : These macro can be
21 // used to implement Wait for event / Signal event on
22 // multi-threaded platform. Default definition is
23 // empty.
24 // ENABLE_THREADING : Must be defined for multi-threaded platform. In this case
25 // CLCPLATFORM_LOCK / CLCPLATFORM_RELEASE / CLCPLATFORM_WAITFOREVENT / CLCPLATFORM_SIGNALEVENT
26 // must be defined correctly. Default is not defined.
27 
28 #ifndef __CLCM_PLATFORM_H__
29 #define __CLCM_PLATFORM_H__
30 
31 #include <string.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #define CLC_SDK_API
38 
39 // C Runtime functions definition
40 #define CLCmemset(Dst, Data, Size) memset(Dst, Data, Size)
41 #define CLCmemcpy(Dst, Src, Size) memcpy(Dst, Src, Size)
42 #define CLCstrlen(Src) strlen(Src)
43 
44 // CLCGetTick definition
45 #include "PerfCounter.h"
46 #define CLCGetTick() PerfCounter_GetMs()
47 
48 // Lock macro : no need as application is "mono-threaded"
49 //#define ENABLE_THREADING
50 #define CLCPLATFORM_LOCK()
51 #define CLCPLATFORM_RELEASE()
52 #define CLCPLATFORM_WAITFOREVENT()
53 #define CLCPLATFORM_SIGNALEVENT()
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif // __CLCM_PLATFORM_H__