diff options
| author | hathach <[email protected]> | 2020-04-01 17:07:28 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-04-01 17:07:28 +0700 |
| commit | a3e50242b9239e1fc0c10d15651222fb3ae3f6d1 (patch) | |
| tree | 86619f6681a05d20313eec3fdee8dd919797ccf4 /examples | |
| parent | 370dd1839465e71caa3024f6f2347b701a94953d (diff) | |
add dcd_esp32s2
skip esp32s2_saola for make build since idf use cmake
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/cdc_msc_freertos/src/main.c | 17 | ||||
| -rw-r--r-- | examples/rules.mk | 4 |
2 files changed, 17 insertions, 4 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; } diff --git a/examples/rules.mk b/examples/rules.mk index 0343391cb..55c70af4b 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -15,14 +15,14 @@ SRC_C += \ src/common/tusb_fifo.c \ src/device/usbd.c \ src/device/usbd_control.c \ - src/class/msc/msc_device.c \ src/class/cdc/cdc_device.c \ src/class/dfu/dfu_rt_device.c \ src/class/hid/hid_device.c \ src/class/midi/midi_device.c \ + src/class/msc/msc_device.c \ + src/class/net/net_device.c \ src/class/usbtmc/usbtmc_device.c \ src/class/vendor/vendor_device.c \ - src/class/net/net_device.c \ src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c # TinyUSB stack include |
