summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-02-28 15:03:18 +0700
committerhathach <[email protected]>2013-02-28 15:06:31 +0700
commitd6548d00636577a7dff4d00470d5cc9c15322ab6 (patch)
treea9f4acc166390250cbddc3224d307b71050b98a3
parentf56f6b67499b3ca2a0b2c18cfba7399a4eea6276 (diff)
strengthen include policy. Only limited headers are allowed to included from a header file. Missing needed to be included in *.c
-rw-r--r--tests/test/host/ehci/test_ehci.c5
-rw-r--r--tinyusb/common/assertion.h7
-rw-r--r--tinyusb/common/binary.h2
-rw-r--r--tinyusb/common/errors.c1
-rw-r--r--tinyusb/common/errors.h3
-rw-r--r--tinyusb/common/timeout_timer.h2
-rw-r--r--tinyusb/core/std_descriptors.h5
-rw-r--r--tinyusb/core/std_request.h5
-rw-r--r--tinyusb/core/tusb_types.h5
9 files changed, 10 insertions, 25 deletions
diff --git a/tests/test/host/ehci/test_ehci.c b/tests/test/host/ehci/test_ehci.c
index c0200e3b0..ec7f821a5 100644
--- a/tests/test/host/ehci/test_ehci.c
+++ b/tests/test/host/ehci/test_ehci.c
@@ -279,9 +279,12 @@ void test_register_portsc(void)
}
//--------------------------------------------------------------------+
-// EHCI Data Organiztion
+// EHCI Data Organization
//--------------------------------------------------------------------+
+void test_(void)
+{
+}
//--------------------------------------------------------------------+
// Helper
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h
index 67aeb90b9..180d046aa 100644
--- a/tinyusb/common/assertion.h
+++ b/tinyusb/common/assertion.h
@@ -62,12 +62,13 @@ extern "C"
// Compile-time Assert
//--------------------------------------------------------------------+
#ifdef __COUNTER__
-#define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __COUNTER__) = 1/(!!(const_expr)) }
+ #define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __COUNTER__) = 1/(!!(const_expr)) }
#else
-#define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __LINE__) = 1/(!!(const_expr)) }
+ #define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, __LINE__) = 1/(!!(const_expr)) }
#endif
+
//#if ( defined CFG_PRINTF_UART || defined CFG_PRINTF_USBCDC || defined CFG_PRINTF_DEBUG )
-#if TUSB_CFG_DEBUG
+#if TUSB_CFG_DEBUG == 3
#define _PRINTF(...) printf(__VA_ARGS__)
#else
#define _PRINTF(...)
diff --git a/tinyusb/common/binary.h b/tinyusb/common/binary.h
index ea0f590e9..f2e12acee 100644
--- a/tinyusb/common/binary.h
+++ b/tinyusb/common/binary.h
@@ -55,8 +55,6 @@
extern "C" {
#endif
-#include "primitive_types.h"
-
/// n-th Bit
#define BIT_(n) (1 << (n))
diff --git a/tinyusb/common/errors.c b/tinyusb/common/errors.c
index 3cc6f838c..3e71bd5db 100644
--- a/tinyusb/common/errors.c
+++ b/tinyusb/common/errors.c
@@ -35,6 +35,7 @@
* This file is part of the tinyUSB stack.
*/
+#include "primitive_types.h"
#include "errors.h"
#if TUSB_CFG_DEBUG == 3
diff --git a/tinyusb/common/errors.h b/tinyusb/common/errors.h
index 5ed6e6549..939f6c433 100644
--- a/tinyusb/common/errors.h
+++ b/tinyusb/common/errors.h
@@ -49,8 +49,7 @@
#ifndef _TUSB_ERRORS_H_
#define _TUSB_ERRORS_H_
-#include "primitive_types.h"
-#include "../tusb_option.h"
+#include "tusb_option.h"
#ifdef __cplusplus
extern "C" {
diff --git a/tinyusb/common/timeout_timer.h b/tinyusb/common/timeout_timer.h
index f994b3c3f..bd2fa28b7 100644
--- a/tinyusb/common/timeout_timer.h
+++ b/tinyusb/common/timeout_timer.h
@@ -51,9 +51,7 @@
#ifndef _TUSB_TIMEOUT_TTIMER_H_
#define _TUSB_TIMEOUT_TTIMER_H_
-#include "primitive_types.h"
#include "compiler/compiler.h"
-#include "osal/osal.h"
#ifdef __cplusplus
extern "C" {
diff --git a/tinyusb/core/std_descriptors.h b/tinyusb/core/std_descriptors.h
index d678f1770..afbffbbf8 100644
--- a/tinyusb/core/std_descriptors.h
+++ b/tinyusb/core/std_descriptors.h
@@ -52,11 +52,6 @@
extern "C" {
#endif
-#include "tusb_option.h"
-#include "common/primitive_types.h"
-#include "common/compiler/compiler.h"
-#include "common/binary.h"
-
//--------------------------------------------------------------------+
// STANDARD DESCRIPTORS
//--------------------------------------------------------------------+
diff --git a/tinyusb/core/std_request.h b/tinyusb/core/std_request.h
index fb004c607..189bc9c2c 100644
--- a/tinyusb/core/std_request.h
+++ b/tinyusb/core/std_request.h
@@ -55,11 +55,6 @@
extern "C" {
#endif
-#include "tusb_option.h"
-#include "common/primitive_types.h"
-#include "common/compiler/compiler.h"
-#include "common/binary.h"
-
typedef ATTR_PREPACKED struct ATTR_PACKED {
ATTR_PREPACKED struct ATTR_PACKED {
uint8_t recipient : 5; /**< Recipient type. */
diff --git a/tinyusb/core/tusb_types.h b/tinyusb/core/tusb_types.h
index a4a093943..a6864cbf4 100644
--- a/tinyusb/core/tusb_types.h
+++ b/tinyusb/core/tusb_types.h
@@ -53,11 +53,6 @@
extern "C" {
#endif
-#include "tusb_option.h"
-#include "common/primitive_types.h"
-#include "common/compiler/compiler.h"
-#include "common/binary.h"
-
/// defined base on EHCI specs value for Endpoint Speed
typedef enum {
TUSB_SPEED_FULL = 0,