mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-19 15:40:41 +00:00
house keeping
- correct initialization call sequence - move hcd_init to ehci.c
This commit is contained in:
parent
d54a12c449
commit
0c397c6b8d
@ -60,13 +60,16 @@
|
||||
//--------------------------------------------------------------------+
|
||||
#define TUSB_CFG_HOST
|
||||
|
||||
//------------- CORE/CONTROLLER -------------//
|
||||
//------------- CONTROLLER -------------//
|
||||
#define TUSB_CFG_HOST_CONTROLLER_NUM 1
|
||||
#define TUSB_CFG_HOST_CONTROLLER_START_INDEX 0
|
||||
|
||||
#define TUSB_CFG_HOST_DEVICE_MAX 1
|
||||
#define TUSB_CFG_CONFIGURATION_MAX 1
|
||||
|
||||
//------------- USBD -------------//
|
||||
#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 256
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define TUSB_CFG_HOST_HID_KEYBOARD 1
|
||||
#define TUSB_CFG_HOST_HID_KEYBOARD_ENDPOINT_SIZE 64
|
||||
|
@ -276,6 +276,11 @@ void test_register_portsc(void)
|
||||
TEST_ASSERT_EQUAL( 26 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, portsc_bit, nxp_port_speed));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// EHCI Data Organiztion
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Helper
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -103,7 +103,7 @@ void test_keyboard_install_ok(void)
|
||||
tusbh_device_status_get_IgnoreAndReturn(TUSB_DEVICE_STATUS_READY);
|
||||
TEST_ASSERT_EQUAL(0, tusbh_hid_keyboard_no_instances(device_hdl));
|
||||
|
||||
TEST_ASSERT_EQUAL(TUSB_ERROR_NONE, class_hid_keyboard_install(device_hdl, (uint8_t*) &kbd_descriptor));
|
||||
TEST_ASSERT_EQUAL(TUSB_ERROR_NONE, hidh_keyboard_install(device_hdl, (uint8_t*) &kbd_descriptor));
|
||||
tusbh_device_status_get_IgnoreAndReturn(TUSB_DEVICE_STATUS_READY);
|
||||
TEST_ASSERT_EQUAL(1, tusbh_hid_keyboard_no_instances(device_hdl));
|
||||
}
|
||||
@ -113,7 +113,7 @@ void test_keyboard_init(void)
|
||||
class_hid_keyboard_info_t keyboard_info_zero[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
memset(keyboard_info_zero, 0, sizeof(class_hid_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
|
||||
class_hid_keyboard_init();
|
||||
hidh_keyboard_init();
|
||||
|
||||
TEST_ASSERT_EQUAL_MEMORY(keyboard_info_zero, keyboard_info_pool, sizeof(class_hid_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include "tusb_option.h"
|
||||
|
||||
#if defined TUSB_CFG_HOST && defined DEVICE_CLASS_HID
|
||||
#if defined TUSB_CFG_HOST && defined HOST_CLASS_HID
|
||||
|
||||
#define _TINY_USB_SOURCE_FILE_
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
#include "common/common.h"
|
||||
#include "hid_host.h"
|
||||
|
||||
#if TUSB_CFG_HOST_HID_KEYBOARD
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
//--------------------------------------------------------------------+
|
||||
@ -89,16 +90,17 @@ uint8_t tusbh_hid_keyboard_no_instances(tusb_handle_device_t const device_hdl)
|
||||
//--------------------------------------------------------------------+
|
||||
// CLASS-USBD API (don't require to verify parameters)
|
||||
//--------------------------------------------------------------------+
|
||||
void class_hid_keyboard_init(void)
|
||||
void hidh_keyboard_init(void)
|
||||
{
|
||||
memclr_(&keyboard_info_pool, sizeof(class_hid_keyboard_info_t)*TUSB_CFG_HOST_DEVICE_MAX);
|
||||
}
|
||||
|
||||
tusb_error_t class_hid_keyboard_install(uint8_t const dev_addr, uint8_t const *descriptor)
|
||||
tusb_error_t hidh_keyboard_install(uint8_t const dev_addr, uint8_t const *descriptor)
|
||||
{
|
||||
keyboard_info_pool[dev_addr].instance_count++;
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -57,6 +57,7 @@
|
||||
#define MCU_LPC13UXX 1
|
||||
#define MCU_LPC11UXX 2
|
||||
#define MCU_LPC43XX 3
|
||||
#define MCU_LPC18XX 4
|
||||
|
||||
#if MCU == 0
|
||||
#error MCU is not defined or supported
|
||||
|
@ -39,9 +39,5 @@
|
||||
|
||||
#ifdef TUSB_CFG_HOST
|
||||
|
||||
tusb_error_t hcd_init(uint8_t coreid)
|
||||
{
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -44,8 +44,7 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
#include "common/common.h"
|
||||
#include "osal/osal.h"
|
||||
#include "tusb.h"
|
||||
#include "usbh_hcd.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -59,6 +59,7 @@
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
#include "common/common.h"
|
||||
#include "osal/osal.h"
|
||||
#include "hcd.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -44,7 +44,7 @@ tusb_error_t tusb_init(void)
|
||||
ASSERT_STATUS( hal_init() ) ; /* HARDWARE INIT */
|
||||
|
||||
#ifdef TUSB_CFG_HOST
|
||||
ASSERT_STATUS( hcd_init(0) );
|
||||
ASSERT_STATUS( usbh_init() );
|
||||
#endif
|
||||
|
||||
#ifdef TUSB_CFG_DEVICE
|
||||
|
@ -49,6 +49,7 @@
|
||||
#endif
|
||||
|
||||
#include "common/common.h"
|
||||
#include "hal/hal.h"
|
||||
|
||||
#ifdef TUSB_CFG_HOST
|
||||
#include "host/usbh.h"
|
||||
|
@ -124,7 +124,6 @@
|
||||
#endif
|
||||
|
||||
#define HOST_CLASS_HID ( TUSB_CFG_HOST_HID_KEYBOARD )
|
||||
#define HOST_EHCI
|
||||
#endif // end TUSB_CFG_HOST
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
Loading…
x
Reference in New Issue
Block a user