summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-01-22 18:09:58 +0700
committerhathach <[email protected]>2013-01-22 18:09:58 +0700
commit3ffda2033a55093a1b1667ed22f523a9a8a6a3d4 (patch)
tree5630457978c47300bc200f7bb8660b6dbc1d61b8 /tinyusb
parent38ce3f7534ec9e3e0b10b8923d7d17e437463e86 (diff)
clear 19.1
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/class/hid.h22
-rw-r--r--tinyusb/class/hid_host.c2
-rw-r--r--tinyusb/class/hid_host.h2
-rw-r--r--tinyusb/hal/hal.h21
-rw-r--r--tinyusb/osal/osal.h12
-rw-r--r--tinyusb/osal/osal_none.c2
6 files changed, 30 insertions, 31 deletions
diff --git a/tinyusb/class/hid.h b/tinyusb/class/hid.h
index f6848be6d..8b3696114 100644
--- a/tinyusb/class/hid.h
+++ b/tinyusb/class/hid.h
@@ -58,6 +58,16 @@
// TODO refractor
#include "common/common.h"
+#ifdef TUSB_CFG_DEVICE
+ #include "device/dcd.h"
+ #include "hid_device.h"
+#endif
+
+#ifdef TUSB_CFG_HOST
+ #include "host/usbd_host.h"
+ #include "hid_host.h"
+#endif
+
/** \struct tusb_mouse_report_t
* \brief Standard HID Boot Protocol Mouse Report.
*
@@ -160,18 +170,6 @@ enum USB_HID_LOCAL_CODE
HID_Local_Turkish_F
};
-#ifdef TUSB_CFG_DEVICE
- #include "device/dcd.h"
- #include "hid_device.h"
-#endif
-
-#ifdef TUSB_CFG_HOST
- #include "host/usbd_host.h"
- #include "hid_host.h"
-#endif
-
-
-
#ifdef __cplusplus
}
#endif
diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c
index d0c3f13ea..dbf19b9f9 100644
--- a/tinyusb/class/hid_host.c
+++ b/tinyusb/class/hid_host.c
@@ -35,7 +35,7 @@
* This file is part of the tiny usb stack.
*/
-#include "hid.h"
+#include "hid_host.h"
#if defined DEVICE_CLASS_HID && defined TUSB_CFG_HOST
diff --git a/tinyusb/class/hid_host.h b/tinyusb/class/hid_host.h
index d0dda7a93..d6be47e1e 100644
--- a/tinyusb/class/hid_host.h
+++ b/tinyusb/class/hid_host.h
@@ -60,7 +60,7 @@
tusb_error_t tusbh_keyboard_get(tusb_handle_configure_t const handle, tusb_keyboard_report_t * const report);
#ifdef __cplusplus
- }
+}
#endif
#endif /* _TUSB_HID_HOST_H_ */
diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h
index 10a5c184e..fa0110d9a 100644
--- a/tinyusb/hal/hal.h
+++ b/tinyusb/hal/hal.h
@@ -62,6 +62,17 @@
#define MCU_LPC11UXX 2
#define MCU_LPC43XX 3
+#if MCU == 0
+ #error MCU is not defined or supported
+#elif MCU == MCU_LPC11UXX
+ #include "hal_lpc11uxx.h"
+#elif MCU == MCU_LPC13UXX
+ #include "hal_lpc13uxx.h"
+#elif MCU == MCU_LPC43XX
+ #include "hal_lpc43xx.h"
+#endif
+
+
/** \brief USB hardware init
*
* \param[in] para1
@@ -81,16 +92,6 @@ static inline void hal_interrupt_enable() ATTR_ALWAYS_INLINE;
*/
static inline void hal_interrupt_disable() ATTR_ALWAYS_INLINE;
-#if MCU == 0
- #error MCU is not defined or supported
-#elif MCU == MCU_LPC11UXX
- #include "hal_lpc11uxx.h"
-#elif MCU == MCU_LPC13UXX
- #include "hal_lpc13uxx.h"
-#elif MCU == MCU_LPC43XX
- #include "hal_lpc43xx.h"
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/tinyusb/osal/osal.h b/tinyusb/osal/osal.h
index 60a3896db..07a65f5b2 100644
--- a/tinyusb/osal/osal.h
+++ b/tinyusb/osal/osal.h
@@ -62,6 +62,12 @@
#define TUSB_OS_FREERTOS 3
#define TUSB_OS_UCOS 4
+#if TUSB_CFG_OS == TUSB_OS_NONE
+ #include "osal_none.h"
+#else
+ #error TUSB_CFG_OS is not defined or OS is not supported yet
+#endif
+
typedef uint32_t osal_status_t; // TODO OSAL port
typedef uint32_t osal_timeout_t; // TODO OSAL port
@@ -78,12 +84,6 @@ typedef uint32_t osal_queue_id_t;
tusb_error_t osal_queue_put(osal_queue_id_t qid, uint32_t data, osal_timeout_t msec);
tusb_error_t osal_queue_get(osal_queue_id_t qid, uint32_t *data, osal_timeout_t msec);
-#if TUSB_CFG_OS == TUSB_OS_NONE
- #include "osal_none.h"
-#else
- #error TUSB_CFG_OS is not defined or OS is not supported yet
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/tinyusb/osal/osal_none.c b/tinyusb/osal/osal_none.c
index 309cc5ea4..4e18a80ee 100644
--- a/tinyusb/osal/osal_none.c
+++ b/tinyusb/osal/osal_none.c
@@ -35,7 +35,7 @@
* This file is part of the tiny usb stack.
*/
-#include "osal.h"
+#include "osal_none.h"
#if TUSB_CFG_OS == TUSB_OS_NONE