add extern "C" for cpp
start to work on hal layer
This commit is contained in:
		| @@ -54,7 +54,7 @@ | ||||
|  | ||||
| #include "arm_mx.h" | ||||
| #include "LPC13Uxx.h" | ||||
|  | ||||
| #include "system_LPC13Uxx.h" | ||||
|  | ||||
|  | ||||
| #endif /* _TUSB_ARCH_LPC134_X_H_ */ | ||||
|   | ||||
| @@ -51,6 +51,10 @@ | ||||
| #ifndef _TUSB_COMMON_H_ | ||||
| #define _TUSB_COMMON_H_ | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| #include <stddef.h> | ||||
| #include <stdbool.h> | ||||
| #include <string.h> | ||||
| @@ -89,6 +93,10 @@ | ||||
|  | ||||
| #define ASSERT_ERROR(sts)		ASSERT_ERROR_MESSAGE(sts, NULL) | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  } | ||||
| #endif | ||||
|  | ||||
| #endif /* _TUSB_COMMON_H_ */ | ||||
|  | ||||
| /**  @} */ | ||||
|   | ||||
| @@ -49,6 +49,10 @@ | ||||
| #ifndef _TUSB_COMPILER_GCC_H_ | ||||
| #define _TUSB_COMPILER_GCC_H_ | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| /// Normally, the compiler places the objects it generates in sections like data or bss & function in text. Sometimes, however, you need additional sections, or you need certain particular variables to appear in special sections, for example to map to special hardware. The section attribute specifies that a variable (or function) lives in a particular section | ||||
| #define ATTR_SECTION(section) 		 __attribute__ ((#section)) | ||||
|  | ||||
| @@ -117,6 +121,10 @@ | ||||
|  | ||||
| /** @} */ | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  } | ||||
| #endif | ||||
|  | ||||
| #endif /* _TUSB_COMPILER_GCC_H_ */ | ||||
|  | ||||
| /// @} | ||||
|   | ||||
| @@ -49,6 +49,10 @@ | ||||
| #ifndef _TUSB_ERRORS_H_ | ||||
| #define _TUSB_ERRORS_H_ | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| /** \enum TUSB_Error_t | ||||
|  *  \brief Error Code returned | ||||
|  */ | ||||
| @@ -60,10 +64,6 @@ typedef enum { | ||||
|   ERROR_COUNT | ||||
| }TUSB_Error_t; | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| /// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG_LEVEL > 0 | ||||
| extern char const* const TUSB_ErrorStr[]; | ||||
|  | ||||
|   | ||||
| @@ -51,6 +51,10 @@ | ||||
|  | ||||
| #include "common/common.h" | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| /** \struct fifo_t | ||||
|  * \brief Simple Circular FIFO | ||||
|  */ | ||||
| @@ -65,9 +69,6 @@ typedef struct _fifo_t | ||||
|   IRQn_Type irq; ///< interrupt used to lock fifo | ||||
| } fifo_t; | ||||
|  | ||||
| #ifdef __cplusplus | ||||
|  extern "C" { | ||||
| #endif | ||||
|  | ||||
| void fifo_init(fifo_t* f, uint8_t* buffer, uint16_t size, bool overwritable, IRQn_Type irq); | ||||
| bool fifo_write(fifo_t* f, uint8_t data); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 hathach
					hathach