Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@ if CHERRYUSB
prompt "Set host serial rx max buffer size"
default 2048

config USBHOST_SERIAL_CMD
bool
prompt "Enable usbh_serial command for shell"
default n
depends on USBHOST_SERIAL

menu "Select USB host template, please select class driver first"
config TEST_USBH_SERIAL
bool
Expand Down
6 changes: 6 additions & 0 deletions Kconfig.rtt
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,12 @@ if RT_USING_CHERRYUSB
prompt "Set host serial rx max buffer size"
default 2048

config CONFIG_USBHOST_SERIAL_CMD
bool
prompt "Enable usbh_serial command for shell"
default n
depends on CONFIG_USBHOST_SERIAL

config RT_LWIP_PBUF_POOL_BUFSIZE
int "The size of each pbuf in the pbuf pool"
range 1500 2000
Expand Down
6 changes: 6 additions & 0 deletions Kconfig.rttpkg
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ if PKG_USING_CHERRYUSB
prompt "Set host serial rx max buffer size"
default 2048

config CONFIG_USBHOST_SERIAL_CMD
bool
prompt "Enable usbh_serial command for shell"
default n
depends on CONFIG_USBHOST_SERIAL

config RT_LWIP_PBUF_POOL_BUFSIZE
int "The size of each pbuf in the pbuf pool"
range 1500 2000
Expand Down
2 changes: 2 additions & 0 deletions class/serial/usbh_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ int usbh_serial_cdc_read_async(struct usbh_serial *serial, uint8_t *buffer, uint
return usbh_submit_urb(urb);
}

#ifdef CONFIG_USBHOST_SERIAL_CMD
void usbh_serial_help(void)
{
USB_LOG_RAW("USB host serial test\r\n"
Expand Down Expand Up @@ -702,6 +703,7 @@ int usbh_serial(int argc, char **argv)

return 0;
}
#endif

__WEAK void usbh_serial_run(struct usbh_serial *serial)
{
Expand Down
2 changes: 2 additions & 0 deletions class/serial/usbh_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ int usbh_serial_cdc_read_async(struct usbh_serial *serial, uint8_t *buffer, uint
void usbh_serial_run(struct usbh_serial *serial);
void usbh_serial_stop(struct usbh_serial *serial);

#ifdef CONFIG_USBHOST_SERIAL_CMD
int usbh_serial(int argc, char **argv);
#endif

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion platform/rtthread/usb_msh.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ MSH_CMD_EXPORT(usbh_init, init usb host);
MSH_CMD_EXPORT(usbh_deinit, deinit usb host);
MSH_CMD_EXPORT(lsusb, ls usb devices);

#ifdef CONFIG_USBHOST_SERIAL
#if defined(CONFIG_USBHOST_SERIAL) && defined(CONFIG_USBHOST_SERIAL_CMD)
#include "usbh_serial.h"
MSH_CMD_EXPORT(usbh_serial, usbh_serial test);
#endif
Expand Down
5 changes: 5 additions & 0 deletions tests/hpmicro/inc/usb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@
#define CONFIG_USBHOST_BLUETOOTH_RX_SIZE 2048
#endif

/* For CI/CD tests */
#ifndef CONFIG_USBHOST_SERIAL_CMD
#define CONFIG_USBHOST_SERIAL_CMD 1
#endif

/* ================ USB Device Port Configuration ================*/

#define CONFIG_USBDEV_MAX_BUS USB_SOC_MAX_COUNT
Expand Down