修复分支报错

This commit is contained in:
Yu Xifeng 2024-08-26 15:50:36 +08:00
parent d79ed5a22b
commit 674ff93b30
3 changed files with 10 additions and 8 deletions

View File

@ -9,9 +9,6 @@
#include "driver/gpio.h" #include "driver/gpio.h"
#include "esp_system.h" #include "esp_system.h"
#include "esp_log.h" #include "esp_log.h"
#include "tinyusb.h"
#include "tusb_cdc_acm.h"
#include "module/include/Sys_Printer.h" #include "module/include/Sys_Printer.h"
#include "module/Printer_Config.h" #include "module/Printer_Config.h"
#include "esp_adc/adc_continuous.h" #include "esp_adc/adc_continuous.h"
@ -57,8 +54,9 @@ void app_main(void)
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size());
#if CONFIG_IDF_TARGET_ESP32S3
Usb_Virtual_serial_port_init(); Usb_Virtual_serial_port_init();
#endif
Printer_group = xEventGroupCreate(); Printer_group = xEventGroupCreate();
button_init(); button_init();

View File

@ -2,8 +2,6 @@
#include "esp_log.h" #include "esp_log.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "tinyusb.h"
#include "tusb_cdc_acm.h"
#include "sdkconfig.h" #include "sdkconfig.h"
#include "include/Sys_Printer.h" #include "include/Sys_Printer.h"
@ -13,6 +11,10 @@ static const char *TAG = "usb_cdc";
extern QueueHandle_t User_data_queue; extern QueueHandle_t User_data_queue;
user_data_t Receive_usb_data; 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]; // static uint8_t buf[CONFIG_TINYUSB_CDC_RX_BUFSIZE + 1];
void tinyusb_cdc_rx_callback(int itf, cdcacm_event_t *event) 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, CDC_EVENT_LINE_STATE_CHANGED,
&tinyusb_cdc_line_state_changed_callback)); &tinyusb_cdc_line_state_changed_callback));
ESP_LOGI(TAG, "USB initialization DONE"); ESP_LOGI(TAG, "USB initialization DONE");
} }
#endif

View File

@ -283,7 +283,7 @@ CONFIG_IDF_TOOLCHAIN="gcc"
CONFIG_IDF_TARGET_ARCH_RISCV=y CONFIG_IDF_TARGET_ARCH_RISCV=y
CONFIG_IDF_TARGET_ARCH="riscv" CONFIG_IDF_TARGET_ARCH="riscv"
CONFIG_IDF_TARGET="esp32c3" 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_TARGET_ESP32C3=y
CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005 CONFIG_IDF_FIRMWARE_CHIP_ID=0x0005