summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-01 17:07:28 +0700
committerhathach <[email protected]>2020-04-01 17:07:28 +0700
commita3e50242b9239e1fc0c10d15651222fb3ae3f6d1 (patch)
tree86619f6681a05d20313eec3fdee8dd919797ccf4 /examples/device
parent370dd1839465e71caa3024f6f2347b701a94953d (diff)
add dcd_esp32s2
skip esp32s2_saola for make build since idf use cmake
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/cdc_msc_freertos/src/main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c
index 704d0803b..514ffa724 100644
--- a/examples/device/cdc_msc_freertos/src/main.c
+++ b/examples/device/cdc_msc_freertos/src/main.c
@@ -56,12 +56,12 @@ StaticTimer_t static_blink;
TimerHandle_t blink_tm;
// static task for usbd
-#define USBD_STACK_SIZE 150
+#define USBD_STACK_SIZE (3*(configMINIMAL_STACK_SIZE/2))
StackType_t stack_usbd[USBD_STACK_SIZE];
StaticTask_t static_task_usbd;
// static task for cdc
-#define CDC_STACK_SZIE 128
+#define CDC_STACK_SZIE configMINIMAL_STACK_SIZE
StackType_t stack_cdc[CDC_STACK_SZIE];
StaticTask_t static_task_cdc;
@@ -71,6 +71,11 @@ void usb_device_task(void* param);
void cdc_task(void* params);
/*------------- MAIN -------------*/
+#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
+// ESP32S2 entry function is app_main()
+#define main app_main
+#endif
+
int main(void)
{
board_init();
@@ -89,8 +94,16 @@ int main(void)
(void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, stack_cdc, &static_task_cdc);
#endif
+#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
+ // skip starting scheduler for ESP32 S2 (already started)
+ while(1)
+ {
+ vTaskSuspend(NULL);
+ }
+#else
vTaskStartScheduler();
NVIC_SystemReset();
+#endif
return 0;
}