summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-12-03 00:30:09 +0700
committerGitHub <[email protected]>2021-12-03 00:30:09 +0700
commit6ecd93eb6051b22c5475a66dc992b5aac0fac96e (patch)
tree51f1d6a4a7cc0667308ed32398824729380087b0 /examples/device
parent9bccc8068baf6efef0bd040ec5238369c0a03c0f (diff)
parent3e9bb3bee1e835a0d99c3f503c63cf0481b45ce2 (diff)
Merge branch 'master' into add_hcd_for_msp_exp432e401y
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_msc_freertos/src/main.c14
-rw-r--r--examples/device/hid_composite_freertos/src/main.c14
2 files changed, 13 insertions, 15 deletions
diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 2d3426f1d..0a1c964ae 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -38,12 +38,17 @@
#include "freertos/queue.h"
#include "freertos/task.h"
#include "freertos/timers.h"
+
+ #define USBD_STACK_SIZE 4096
#else
#include "FreeRTOS.h"
#include "semphr.h"
#include "queue.h"
#include "task.h"
#include "timers.h"
+
+ // Increase stack size when debug log is enabled
+ #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
#endif
//--------------------------------------------------------------------+
@@ -65,14 +70,7 @@ enum {
StaticTimer_t blinky_tmdef;
TimerHandle_t blinky_tm;
-// static task for usbd
-// Increase stack size when debug log is enabled
-#if CFG_TUSB_DEBUG
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE)
-#else
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
-#endif
-
+// static task
StackType_t usb_device_stack[USBD_STACK_SIZE];
StaticTask_t usb_device_taskdef;
diff --git a/examples/device/hid_composite_freertos/src/main.c b/examples/device/hid_composite_freertos/src/main.c
index 336f5d426..1695f968c 100644
--- a/examples/device/hid_composite_freertos/src/main.c
+++ b/examples/device/hid_composite_freertos/src/main.c
@@ -39,12 +39,18 @@
#include "freertos/queue.h"
#include "freertos/task.h"
#include "freertos/timers.h"
+
+ #define USBD_STACK_SIZE 4096
+
#else
#include "FreeRTOS.h"
#include "semphr.h"
#include "queue.h"
#include "task.h"
#include "timers.h"
+
+ // Increase stack size when debug log is enabled
+ #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
#endif
//--------------------------------------------------------------------+
@@ -66,13 +72,7 @@ enum {
StaticTimer_t blinky_tmdef;
TimerHandle_t blinky_tm;
-// static task for usbd
-#if CFG_TUSB_DEBUG
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE)
-#else
- #define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2)
-#endif
-
+// static task
StackType_t usb_device_stack[USBD_STACK_SIZE];
StaticTask_t usb_device_taskdef;