minor house keeping
This commit is contained in:
parent
99ad3ae2ca
commit
309540473b
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "tusb_option.h"
|
#include "tusb_option.h"
|
||||||
|
|
||||||
#if CFG_TUH_ENABLED & CFG_TUH_MSC
|
#if CFG_TUH_ENABLED && CFG_TUH_MSC
|
||||||
|
|
||||||
#include "host/usbh.h"
|
#include "host/usbh.h"
|
||||||
#include "host/usbh_classdriver.h"
|
#include "host/usbh_classdriver.h"
|
||||||
|
|
|
@ -64,6 +64,8 @@ typedef enum
|
||||||
#if CFG_TUSB_DEBUG
|
#if CFG_TUSB_DEBUG
|
||||||
/// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG > 0
|
/// Enum to String for debugging purposes. Only available if \ref CFG_TUSB_DEBUG > 0
|
||||||
extern char const* const tusb_strerr[TUSB_ERROR_COUNT];
|
extern char const* const tusb_strerr[TUSB_ERROR_COUNT];
|
||||||
|
extern char const* const tusb_speed_str[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -332,8 +332,6 @@ static char const* const _tusb_std_request_str[] =
|
||||||
"Synch Frame"
|
"Synch Frame"
|
||||||
};
|
};
|
||||||
|
|
||||||
static char const* const _tusb_speed_str[] = { "Full", "Low", "High" };
|
|
||||||
|
|
||||||
// for usbd_control to print the name of control complete driver
|
// for usbd_control to print the name of control complete driver
|
||||||
void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback)
|
void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback)
|
||||||
{
|
{
|
||||||
|
@ -509,7 +507,7 @@ void tud_task (void)
|
||||||
switch ( event.event_id )
|
switch ( event.event_id )
|
||||||
{
|
{
|
||||||
case DCD_EVENT_BUS_RESET:
|
case DCD_EVENT_BUS_RESET:
|
||||||
TU_LOG2(": %s Speed\r\n", _tusb_speed_str[event.bus_reset.speed]);
|
TU_LOG2(": %s Speed\r\n", tusb_speed_str[event.bus_reset.speed]);
|
||||||
usbd_reset(event.rhport);
|
usbd_reset(event.rhport);
|
||||||
_usbd_dev.speed = event.bus_reset.speed;
|
_usbd_dev.speed = event.bus_reset.speed;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -709,6 +709,7 @@ static bool enum_new_device(hcd_event_t* event)
|
||||||
if ( !hcd_port_connect_status(_dev0.rhport) ) return true;
|
if ( !hcd_port_connect_status(_dev0.rhport) ) return true;
|
||||||
|
|
||||||
_dev0.speed = hcd_port_speed_get(_dev0.rhport );
|
_dev0.speed = hcd_port_speed_get(_dev0.rhport );
|
||||||
|
TU_LOG2("%s Speed\r\n", tusb_speed_str[_dev0.speed]);
|
||||||
|
|
||||||
enum_request_addr0_device_desc();
|
enum_request_addr0_device_desc();
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,8 @@ uint16_t tu_desc_get_interface_total_len(tusb_desc_interface_t const* desc_itf,
|
||||||
|
|
||||||
char const* const tusb_strerr[TUSB_ERROR_COUNT] = { ERROR_TABLE(ERROR_STRING) };
|
char const* const tusb_strerr[TUSB_ERROR_COUNT] = { ERROR_TABLE(ERROR_STRING) };
|
||||||
|
|
||||||
|
char const* const tusb_speed_str[] = { "Full", "Low", "High" };
|
||||||
|
|
||||||
static void dump_str_line(uint8_t const* buf, uint16_t count)
|
static void dump_str_line(uint8_t const* buf, uint16_t count)
|
||||||
{
|
{
|
||||||
tu_printf(" |");
|
tu_printf(" |");
|
||||||
|
|
|
@ -223,8 +223,19 @@
|
||||||
// CFG_TUD_SPEED OPT_MODE_HIGH_SPEED
|
// CFG_TUD_SPEED OPT_MODE_HIGH_SPEED
|
||||||
|
|
||||||
//------------- Roothub as Host -------------//
|
//------------- Roothub as Host -------------//
|
||||||
#define TUH_OPT_RHPORT ( ((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_HOST) ? 0 : (((CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HOST) ? 1 : -1) )
|
|
||||||
#define CFG_TUH_ENABLED ( TUH_OPT_RHPORT >= 0 )
|
#if (CFG_TUSB_RHPORT0_MODE) & OPT_MODE_HOST
|
||||||
|
#define TUH_RHPORT_MODE (CFG_TUSB_RHPORT0_MODE)
|
||||||
|
#define TUH_OPT_RHPORT 0
|
||||||
|
#elif (CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HOST
|
||||||
|
#define TUH_RHPORT_MODE (CFG_TUSB_RHPORT1_MODE)
|
||||||
|
#define TUH_OPT_RHPORT 1
|
||||||
|
#else
|
||||||
|
#define TUH_RHPORT_MODE OPT_MODE_NONE
|
||||||
|
#define TUH_OPT_RHPORT -1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CFG_TUH_ENABLED ( TUH_RHPORT_MODE & OPT_MODE_HOST )
|
||||||
|
|
||||||
// For backward compatible
|
// For backward compatible
|
||||||
#define TUSB_OPT_DEVICE_ENABLED CFG_TUD_ENABLED
|
#define TUSB_OPT_DEVICE_ENABLED CFG_TUD_ENABLED
|
||||||
|
|
Loading…
Reference in New Issue