Merge pull request #265 from mck1117/msd-options

Allow configuration of MSD thread
This commit is contained in:
Fabien Poussin 2021-03-07 23:17:54 +01:00 committed by GitHub
commit fdcbac6a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -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.
*/

View File

@ -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