Skip to content

Commit

Permalink
Merge pull request #265 from mck1117/msd-options
Browse files Browse the repository at this point in the history
Allow configuration of MSD thread
  • Loading branch information
fpoussin committed Mar 7, 2021
2 parents e7cdad3 + 609b49a commit fdcbac6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 15 additions & 1 deletion os/hal/include/hal_usb_msd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
/*===========================================================================*/
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 0 additions & 2 deletions os/hal/src/hal_usb_msd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fdcbac6

Please sign in to comment.