diff --git a/main/main.c b/main/main.c index 46974a7..f167cc1 100644 --- a/main/main.c +++ b/main/main.c @@ -9,9 +9,6 @@ #include "driver/gpio.h" #include "esp_system.h" #include "esp_log.h" -#include "tinyusb.h" -#include "tusb_cdc_acm.h" - #include "module/include/Sys_Printer.h" #include "module/Printer_Config.h" #include "esp_adc/adc_continuous.h" @@ -57,8 +54,9 @@ void app_main(void) (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); +#if CONFIG_IDF_TARGET_ESP32S3 Usb_Virtual_serial_port_init(); - +#endif Printer_group = xEventGroupCreate(); button_init(); diff --git a/main/module/USB/usb_cdc.c b/main/module/USB/usb_cdc.c index 93152c8..7f11c3a 100644 --- a/main/module/USB/usb_cdc.c +++ b/main/module/USB/usb_cdc.c @@ -2,8 +2,6 @@ #include "esp_log.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "tinyusb.h" -#include "tusb_cdc_acm.h" #include "sdkconfig.h" #include "include/Sys_Printer.h" @@ -13,6 +11,10 @@ static const char *TAG = "usb_cdc"; extern QueueHandle_t User_data_queue; user_data_t Receive_usb_data; +#if CONFIG_IDF_TARGET_ESP32S3 +#include "tinyusb.h" +#include "tusb_cdc_acm.h" + // static uint8_t buf[CONFIG_TINYUSB_CDC_RX_BUFSIZE + 1]; void tinyusb_cdc_rx_callback(int itf, cdcacm_event_t *event) @@ -75,4 +77,6 @@ void Usb_Virtual_serial_port_init(void) CDC_EVENT_LINE_STATE_CHANGED, &tinyusb_cdc_line_state_changed_callback)); ESP_LOGI(TAG, "USB initialization DONE"); -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/sdkconfig b/sdkconfig index d726992..1f0f9aa 100644 --- a/sdkconfig +++ b/sdkconfig @@ -283,7 +283,7 @@ CONFIG_IDF_TOOLCHAIN="gcc" CONFIG_IDF_TARGET_ARCH_RISCV=y CONFIG_IDF_TARGET_ARCH="riscv" CONFIG_IDF_TARGET="esp32c3" -CONFIG_IDF_INIT_VERSION="$IDF_INIT_VERSION" +CONFIG_IDF_INIT_VERSION="5.3.0" CONFIG_IDF_TARGET_ESP32C3=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005