diff options
| author | hathach <[email protected]> | 2012-11-27 15:21:47 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2012-11-27 15:21:47 +0700 |
| commit | 06c16ae03f0c6b70283392b057137ac20fcb4d82 (patch) | |
| tree | 64cd3847bd9cfa9c52ebc8d5ea957476a110024a /tinyusb/common | |
| parent | e62963844bc41f16f4ec0da686c20019eae31c04 (diff) | |
added files
added some template code
Diffstat (limited to 'tinyusb/common')
| -rw-r--r-- | tinyusb/common/arch/arch.h | 6 | ||||
| -rw-r--r-- | tinyusb/common/arch/arch_lpc134x.h | 10 | ||||
| -rw-r--r-- | tinyusb/common/arch/arch_lpc43xx.h | 6 | ||||
| -rw-r--r-- | tinyusb/common/arch/arm_mx.h | 6 | ||||
| -rw-r--r-- | tinyusb/common/common.h | 7 | ||||
| -rw-r--r-- | tinyusb/common/compiler/compiler.h | 6 | ||||
| -rw-r--r-- | tinyusb/common/compiler/compiler_gcc.h | 6 | ||||
| -rw-r--r-- | tinyusb/common/errors.c | 37 | ||||
| -rw-r--r-- | tinyusb/common/errors.h | 42 |
9 files changed, 104 insertions, 22 deletions
diff --git a/tinyusb/common/arch/arch.h b/tinyusb/common/arch/arch.h index 3c86c41e3..9a48864e7 100644 --- a/tinyusb/common/arch/arch.h +++ b/tinyusb/common/arch/arch.h @@ -35,8 +35,8 @@ * This file is part of the tiny usb stack. */ -#ifndef ARCH_H_ -#define ARCH_H_ +#ifndef _TUSB_ARCH_H_ +#define _TUSB_ARCH_H_ #define ARCH_LPC134X 1 #define ARCH_LPC43XX 2 @@ -51,4 +51,4 @@ #endif -#endif /* ARCH_H_ */ +#endif /* _TUSB_ARCH_H_ */ diff --git a/tinyusb/common/arch/arch_lpc134x.h b/tinyusb/common/arch/arch_lpc134x.h index ca6c9d097..14002161f 100644 --- a/tinyusb/common/arch/arch_lpc134x.h +++ b/tinyusb/common/arch/arch_lpc134x.h @@ -35,11 +35,13 @@ * This file is part of the tiny usb stack. */ -#ifndef ARCH_LPC134X_H_ -#define ARCH_LPC134X_H_ +#ifndef _TUSB_ARCH_LPC134_X_H_ +#define _TUSB_ARCH_LPC134_X_H_ + +#include "arm_mx.h" #define ARM ARM_M3 -#include "arm_mx.h" +#define DEVICE_ROMDRIVER -#endif /* ARCH_LPC134X_H_ */ +#endif /* _TUSB_ARCH_LPC134_X_H_ */ diff --git a/tinyusb/common/arch/arch_lpc43xx.h b/tinyusb/common/arch/arch_lpc43xx.h index b05ed1fcd..9af504457 100644 --- a/tinyusb/common/arch/arch_lpc43xx.h +++ b/tinyusb/common/arch/arch_lpc43xx.h @@ -35,12 +35,12 @@ * This file is part of the tiny usb stack. */ -#ifndef ARCH_LPC43XX_H_ -#define ARCH_LPC43XX_H_ +#ifndef _TUSB_ARCH_LPC43XX_H_ +#define _TUSB_ARCH_LPC43XX_H_ #define ARM ARM_M4 //#define ARM ARM_M0 #include "arm_mx.h" -#endif /* ARCH_LPC43XX_H_ */ +#endif /* _TUSB_ARCH_LPC43XX_H_ */ diff --git a/tinyusb/common/arch/arm_mx.h b/tinyusb/common/arch/arm_mx.h index 16b6fc458..5546193eb 100644 --- a/tinyusb/common/arch/arm_mx.h +++ b/tinyusb/common/arch/arm_mx.h @@ -35,10 +35,10 @@ * This file is part of the tiny usb stack. */ -#ifndef ARM_MX_H_ -#define ARM_MX_H_ +#ifndef _TUSB_ARM_MX_H_ +#define _TUSB_ARM_MX_H_ #define ENDIAN_LITTLE #define ALIGNMENT (4) -#endif /* ARM_MX_H_ */ +#endif /* _TUSB_ARM_MX_H_ */ diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h index 466e08a28..40508b6fa 100644 --- a/tinyusb/common/common.h +++ b/tinyusb/common/common.h @@ -35,10 +35,11 @@ * This file is part of the tiny usb stack. */ -#ifndef COMMON_H_ -#define COMMON_H_ +#ifndef _TUSB_COMMON_H_ +#define _TUSB_COMMON_H_ #include "arch/arch.h" #include "compiler/compiler.h" +#include "errors.h" -#endif /* COMMON_H_ */ +#endif /* _TUSB_COMMON_H_ */ diff --git a/tinyusb/common/compiler/compiler.h b/tinyusb/common/compiler/compiler.h index f3a90d70c..0114063e4 100644 --- a/tinyusb/common/compiler/compiler.h +++ b/tinyusb/common/compiler/compiler.h @@ -35,11 +35,11 @@ * This file is part of the tiny usb stack. */ -#ifndef COMPILER_H_ -#define COMPILER_H_ +#ifndef _TUSB_COMPILER_H_ +#define _TUSB_COMPILER_H_ #if defined(__GNUC__) #include "compiler_gcc.h" #endif -#endif /* COMPILER_H_ */ +#endif /* _TUSB_COMPILER_H_ */ diff --git a/tinyusb/common/compiler/compiler_gcc.h b/tinyusb/common/compiler/compiler_gcc.h index b6a4286c2..e2671764f 100644 --- a/tinyusb/common/compiler/compiler_gcc.h +++ b/tinyusb/common/compiler/compiler_gcc.h @@ -35,8 +35,8 @@ * This file is part of the tiny usb stack. */ -#ifndef COMPILER_GCC_H_ -#define COMPILER_GCC_H_ +#ifndef _TUSB_COMPILER_GCC_H_ +#define _TUSB_COMPILER_GCC_H_ #define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes))) #define ATTR_PACKED __attribute__ ((packed)) @@ -52,4 +52,4 @@ #define ATTR_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) #define ATTR_ALWAYS_INLINE __attribute__ ((always_inline)) -#endif /* COMPILER_GCC_H_ */ +#endif /* _TUSB_COMPILER_GCC_H_ */ diff --git a/tinyusb/common/errors.c b/tinyusb/common/errors.c new file mode 100644 index 000000000..90753786b --- /dev/null +++ b/tinyusb/common/errors.c @@ -0,0 +1,37 @@ +/* + * errors.c + * + * Created on: Nov 27, 2012 + * Author: hathach ([email protected]) + */ + +/* + * Software License Agreement (BSD License) + * Copyright (c) 2012, hathach ([email protected]) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the tiny usb stack. + */ + diff --git a/tinyusb/common/errors.h b/tinyusb/common/errors.h new file mode 100644 index 000000000..0106fb988 --- /dev/null +++ b/tinyusb/common/errors.h @@ -0,0 +1,42 @@ +/* + * errors.h + * + * Created on: Nov 27, 2012 + * Author: hathach ([email protected]) + */ + +/* + * Software License Agreement (BSD License) + * Copyright (c) 2012, hathach ([email protected]) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the tiny usb stack. + */ + +#ifndef _TUSB_ERRORS_H_ +#define _TUSB_ERRORS_H_ + + +#endif /* _TUSB_ERRORS_H_ */ |
