added _cplusplus extern wrapper

This commit is contained in:
hathach 2012-11-27 15:35:57 +07:00
parent 06c16ae03f
commit 829c8672bb
12 changed files with 103 additions and 3 deletions

View File

@ -38,6 +38,10 @@
#ifndef _TUSB_ARCH_H_
#define _TUSB_ARCH_H_
#ifdef __cplusplus
extern "C" {
#endif
#define ARCH_LPC134X 1
#define ARCH_LPC43XX 2
#define ARCH ARCH_LPC134X
@ -51,4 +55,8 @@
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_ARCH_H_ */

View File

@ -38,10 +38,18 @@
#ifndef _TUSB_ARCH_LPC134_X_H_
#define _TUSB_ARCH_LPC134_X_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "arm_mx.h"
#define ARM ARM_M3
#define DEVICE_ROMDRIVER
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_ARCH_LPC134_X_H_ */

View File

@ -38,9 +38,17 @@
#ifndef _TUSB_ARCH_LPC43XX_H_
#define _TUSB_ARCH_LPC43XX_H_
#ifdef __cplusplus
extern "C" {
#endif
#define ARM ARM_M4
//#define ARM ARM_M0
#include "arm_mx.h"
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_ARCH_LPC43XX_H_ */

View File

@ -38,7 +38,15 @@
#ifndef _TUSB_ARM_MX_H_
#define _TUSB_ARM_MX_H_
#ifdef __cplusplus
extern "C" {
#endif
#define ENDIAN_LITTLE
#define ALIGNMENT (4)
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_ARM_MX_H_ */

View File

@ -38,8 +38,16 @@
#ifndef _TUSB_COMMON_H_
#define _TUSB_COMMON_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "arch/arch.h"
#include "compiler/compiler.h"
#include "errors.h"
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_COMMON_H_ */

View File

@ -38,8 +38,16 @@
#ifndef _TUSB_COMPILER_H_
#define _TUSB_COMPILER_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__GNUC__)
#include "compiler_gcc.h"
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_COMPILER_H_ */

View File

@ -35,6 +35,10 @@
* This file is part of the tiny usb stack.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _TUSB_COMPILER_GCC_H_
#define _TUSB_COMPILER_GCC_H_
@ -52,4 +56,8 @@
#define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
#define ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_COMPILER_GCC_H_ */

View File

@ -38,5 +38,13 @@
#ifndef _TUSB_ERRORS_H_
#define _TUSB_ERRORS_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_ERRORS_H_ */

View File

@ -38,10 +38,18 @@
#ifndef _TUSB_DCD_H_
#define _TUSB_DCD_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "tusb_cfg.h"
#ifdef DEVICE_ROMDRIVER
#include "romdriver/mw_usbd_rom_api.h"
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_DCD_H_ */

View File

@ -35,3 +35,15 @@
* This file is part of the tiny usb stack.
*/
#ifndef _TUSB_HCD_H_
#define _TUSB_HCD_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_HCD_H_ */

View File

@ -35,8 +35,12 @@
* This file is part of the tiny usb stack.
*/
#ifndef TUSB_H_
#define TUSB_H_
#ifndef _TUSB_H_
#define _TUSB_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "common/common.h"
#include "tusb_cfg.h"
@ -45,4 +49,8 @@
#include "device/dcd.h"
#endif
#endif /* TUSB_H_ */
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_H_ */

View File

@ -38,6 +38,10 @@
#ifndef _TUSB_CFG_H_
#define _TUSB_CFG_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "common/common.h"
#define CFG_TUSB_HOST
@ -66,4 +70,8 @@
#define CDC_NOTIFICATION_EP_MAXPACKETSIZE 8
#define CDC_DATA_EP_MAXPACKET_SIZE 16
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_CFG_H_ */