hathach 13 лет назад
Родитель
Сommit
3ffda2033a
6 измененных файлов с 30 добавлено и 31 удалено
  1. 10 12
      tinyusb/class/hid.h
  2. 1 1
      tinyusb/class/hid_host.c
  3. 1 1
      tinyusb/class/hid_host.h
  4. 11 10
      tinyusb/hal/hal.h
  5. 6 6
      tinyusb/osal/osal.h
  6. 1 1
      tinyusb/osal/osal_none.c

+ 10 - 12
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

+ 1 - 1
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
 

+ 1 - 1
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_ */

+ 11 - 10
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

+ 6 - 6
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

+ 1 - 1
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