diff --git a/os/hal/include/hal_usb_msd.h b/os/hal/include/hal_usb_msd.h index 0fe03e4a..232c5c4c 100644 --- a/os/hal/include/hal_usb_msd.h +++ b/os/hal/include/hal_usb_msd.h @@ -39,6 +39,20 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief Set the size of the USB MSD thread's stack working area + */ +#if !defined(USB_MSD_THREAD_WA_SIZE) || defined(__DOXYGEN__) +#define USB_MSD_THREAD_WA_SIZE 256 +#endif + +/** + * @brief Set the priority of the USB MSD thread. Defaults to NORMALPRIO. + */ +#if !defined(MSD_THD_PRIO) || defined(__DOXYGEN__) +#define MSD_THD_PRIO NORMALPRIO +#endif + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ @@ -132,7 +146,7 @@ struct USBMassStorageDriver { /** * @brief Thread working area. */ - THD_WORKING_AREA( waMSDWorker, 512); + THD_WORKING_AREA( waMSDWorker, USB_MSD_THREAD_WA_SIZE); /** * @brief Worker thread handler. */ diff --git a/os/hal/src/hal_usb_msd.c b/os/hal/src/hal_usb_msd.c index 770a6bf9..8d07223d 100644 --- a/os/hal/src/hal_usb_msd.c +++ b/os/hal/src/hal_usb_msd.c @@ -38,8 +38,6 @@ #define MSD_CBW_SIGNATURE 0x43425355 #define MSD_CSW_SIGNATURE 0x53425355 -#define MSD_THD_PRIO NORMALPRIO - #define CBW_FLAGS_RESERVED_MASK 0b01111111 #define CBW_LUN_RESERVED_MASK 0b11110000 #define CBW_CMD_LEN_RESERVED_MASK 0b11000000