diff --git a/hw/bsp/esp32-s3-arduino/Kconfig b/hw/bsp/esp32-s3-arduino/Kconfig new file mode 100644 index 00000000..e69de29b diff --git a/hw/bsp/esp32-s3-arduino/board.cmake b/hw/bsp/esp32-s3-arduino/board.cmake new file mode 100644 index 00000000..6f7a1de2 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/board.cmake @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 3.16) + +# Include for ESP-IDF build system functions +include($ENV{IDF_PATH}/tools/cmake/idf.cmake) + +add_compile_options(-Wno-missing-field-initializers -Wno-write-strings) +add_compile_definitions(ARDUINO_USB_CDC_ON_BOOT=1 ARDUINO_USB_MODE=1) + +# Create idf::{target} and idf::freertos static libraries +idf_build_process("esp32s3" + # try and trim the build; additional components + # will be included as needed based on dependency tree + # + # although esptool_py does not generate static library, + # processing the component is needed for flashing related + # targets and file generation + COMPONENTS freertos esptool_py driver nvs_flash bt esp_http_client esp_https_ota arduino-esp32 + SDKCONFIG ${BOARD_DIR}/sdkconfig + BUILD_DIR ${CMAKE_BINARY_DIR}) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +set(elf_file ${CMAKE_PROJECT_NAME}.elf) +add_executable(${elf_file} ${BOARD_DIR}/main.cpp) + +# Link the static libraries to the executable +target_link_libraries( + ${elf_file} + idf::bt + idf::freertos + idf::spi_flash + idf::driver + idf::nvs_flash + idf::esp_wifi + idf::esp_http_client + idf::esp_https_ota + idf::arduino-esp32 + bsp + system + robot +) +# Attach additional targets to the executable file for flashing, +# linker script generation, partition_table generation, etc. +idf_build_executable(${elf_file}) + +add_subdirectory(${BOARD_DIR}/drivers) + +# add_compile_options(-Wno-missing-field-initializers) + +target_include_directories( + ${PROJECT_NAME}.elf + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE $ENV{IDF_PATH}/components/esp_http_client/include + PRIVATE $ + PRIVATE $ + PRIVATE $ +) diff --git a/hw/bsp/esp32-s3-arduino/config/ble_net_config.config b/hw/bsp/esp32-s3-arduino/config/ble_net_config.config new file mode 100644 index 00000000..5f619a6b --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/config/ble_net_config.config @@ -0,0 +1,94 @@ +# CONFIG_auto_generated_config_prefix_board-esp32-c3-idf is not set +# CONFIG_auto_generated_config_prefix_board-c-mini is not set +# CONFIG_auto_generated_config_prefix_board-raspi_4b_with_ch348 is not set +# CONFIG_auto_generated_config_prefix_board-node_imu is not set +CONFIG_auto_generated_config_prefix_board-esp32-s3-arduino=y +# CONFIG_auto_generated_config_prefix_board-f103_can is not set +# CONFIG_auto_generated_config_prefix_board-MiniPC is not set +# CONFIG_auto_generated_config_prefix_board-rm-c is not set +# CONFIG_auto_generated_config_prefix_board-microswitch is not set +# CONFIG_auto_generated_config_prefix_board-Webots is not set +# CONFIG_auto_generated_config_prefix_board-wl_f103_can is not set +# CONFIG_auto_generated_config_prefix_board-demo-board is not set +# CONFIG_auto_generated_config_prefix_system-Linux_Webots is not set +CONFIG_auto_generated_config_prefix_system-FreeRTOS=y +# CONFIG_auto_generated_config_prefix_system-None is not set +# CONFIG_auto_generated_config_prefix_system-Linux is not set +CONFIG_INIT_TASK_STACK_DEPTH=4096 + +# +# FreeRTOS +# +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_USB_TASK_STACK_DEPTH=1024 +CONFIG_FREERTOS_TERM_TASK_STACK_DEPTH=1024 +# end of FreeRTOS + +# CONFIG_auto_generated_config_prefix_robot-udp_to_uart is not set +# CONFIG_auto_generated_config_prefix_robot-hero is not set +# CONFIG_auto_generated_config_prefix_robot-balance_infantry is not set +# CONFIG_auto_generated_config_prefix_robot-sentry is not set +# CONFIG_auto_generated_config_prefix_robot-dart is not set +CONFIG_auto_generated_config_prefix_robot-ble_net_config=y +# CONFIG_auto_generated_config_prefix_robot-can_to_uart is not set +# CONFIG_auto_generated_config_prefix_robot-infantry is not set +# CONFIG_auto_generated_config_prefix_robot-sim_mecanum is not set +# CONFIG_auto_generated_config_prefix_robot-blink is not set +# CONFIG_auto_generated_config_prefix_robot-microswitch is not set +# CONFIG_auto_generated_config_prefix_robot-sim_balance is not set +# CONFIG_auto_generated_config_prefix_robot-engineer is not set +# CONFIG_auto_generated_config_prefix_robot-wearlab_imu is not set +# CONFIG_auto_generated_config_prefix_robot-demo-robot is not set + +# +# 组件 +# +# CONFIG_auto_generated_config_prefix_component-demo-component is not set +# end of 组件 + +# +# 设备 +# +# CONFIG_auto_generated_config_prefix_device-servo is not set +# CONFIG_auto_generated_config_prefix_device-simulator is not set +# CONFIG_auto_generated_config_prefix_device-cap is not set +# CONFIG_auto_generated_config_prefix_device-led_rgb is not set +# CONFIG_auto_generated_config_prefix_device-referee is not set +# CONFIG_auto_generated_config_prefix_device-laser is not set +# CONFIG_auto_generated_config_prefix_device-can is not set +# CONFIG_auto_generated_config_prefix_device-motor is not set +# CONFIG_auto_generated_config_prefix_device-bmi088 is not set +# CONFIG_auto_generated_config_prefix_device-mech is not set +# CONFIG_auto_generated_config_prefix_device-buzzer is not set +# CONFIG_auto_generated_config_prefix_device-tof is not set +CONFIG_auto_generated_config_prefix_device-blink_led=y +# CONFIG_auto_generated_config_prefix_device-dr16 is not set +# CONFIG_auto_generated_config_prefix_device-ahrs is not set +# CONFIG_auto_generated_config_prefix_device-ai is not set +CONFIG_auto_generated_config_prefix_device-net_config=y +# CONFIG_auto_generated_config_prefix_device-wearlab is not set +# CONFIG_auto_generated_config_prefix_device-imu is not set +# CONFIG_auto_generated_config_prefix_device-microswitch is not set +# CONFIG_auto_generated_config_prefix_device-demo-device is not set +# end of 设备 + +# +# 模块 +# +# CONFIG_auto_generated_config_prefix_module-gimbal is not set +# CONFIG_auto_generated_config_prefix_module-balance is not set +# CONFIG_auto_generated_config_prefix_module-chassis is not set +# CONFIG_auto_generated_config_prefix_module-dart_launcher is not set +CONFIG_auto_generated_config_prefix_module-ble_net_config=y +# CONFIG_auto_generated_config_prefix_module-launcher is not set +# CONFIG_auto_generated_config_prefix_module-ore_collect is not set +# CONFIG_auto_generated_config_prefix_module-can_usart is not set +# CONFIG_auto_generated_config_prefix_module-uart_udp is not set +CONFIG_auto_generated_config_prefix_module-topic_share_uart=y +# CONFIG_auto_generated_config_prefix_module-microswitch is not set +# CONFIG_auto_generated_config_prefix_module-can_imu is not set +# CONFIG_auto_generated_config_prefix_module-wheel_leg is not set +# CONFIG_auto_generated_config_prefix_module-dart_gimbal is not set +# CONFIG_auto_generated_config_prefix_module-wl_can_usart is not set +# CONFIG_auto_generated_config_prefix_module-demo-module is not set +# end of 模块 diff --git a/hw/bsp/esp32-s3-arduino/config/blink.config b/hw/bsp/esp32-s3-arduino/config/blink.config new file mode 100644 index 00000000..11549796 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/config/blink.config @@ -0,0 +1,58 @@ +CONFIG_auto_generated_config_prefix_board-esp32-s3-arduino=y +# CONFIG_auto_generated_config_prefix_board-node_imu is not set +# CONFIG_auto_generated_config_prefix_board-MiniPC is not set +# CONFIG_auto_generated_config_prefix_board-rm-c is not set +# CONFIG_auto_generated_config_prefix_board-Webots is not set +# CONFIG_auto_generated_config_prefix_system-Linux_Webots is not set +CONFIG_auto_generated_config_prefix_system-FreeRTOS=y +# CONFIG_auto_generated_config_prefix_system-Linux is not set +CONFIG_INIT_TASK_STACK_DEPTH=2048 + +# +# FreeRTOS +# +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=1024 +CONFIG_FREERTOS_USB_TASK_STACK_DEPTH=1024 +CONFIG_FREERTOS_TERM_TASK_STACK_DEPTH=1024 +# end of FreeRTOS + +# CONFIG_auto_generated_config_prefix_robot-balance_infantry is not set +# CONFIG_auto_generated_config_prefix_robot-infantry is not set +# CONFIG_auto_generated_config_prefix_robot-sim_mecanum is not set +CONFIG_auto_generated_config_prefix_robot-blink=y +CONFIG_auto_generated_config_prefix_module-performance=y +# CONFIG_auto_generated_config_prefix_robot-sim_balance is not set +# CONFIG_auto_generated_config_prefix_robot-wearlab_imu is not set + +# +# 设备 +# +# CONFIG_auto_generated_config_prefix_device-servo is not set +# CONFIG_auto_generated_config_prefix_device-simulator is not set +# CONFIG_auto_generated_config_prefix_device-cap is not set +# CONFIG_auto_generated_config_prefix_device-led_rgb is not set +# CONFIG_auto_generated_config_prefix_device-referee is not set +# CONFIG_auto_generated_config_prefix_device-laser is not set +# CONFIG_auto_generated_config_prefix_device-can is not set +# CONFIG_auto_generated_config_prefix_device-motor is not set +# CONFIG_auto_generated_config_prefix_device-bmi088 is not set +# CONFIG_auto_generated_config_prefix_device-buzzer is not set +# CONFIG_auto_generated_config_prefix_device-tof is not set +CONFIG_auto_generated_config_prefix_device-blink_led=y +# CONFIG_auto_generated_config_prefix_device-dr16 is not set +# CONFIG_auto_generated_config_prefix_device-ahrs is not set +# CONFIG_auto_generated_config_prefix_device-ai is not set +# CONFIG_auto_generated_config_prefix_device-wearlab is not set +# CONFIG_auto_generated_config_prefix_device-imu is not set +# end of 设备 + +# +# 模块 +# +# CONFIG_auto_generated_config_prefix_module-gimbal is not set +# CONFIG_auto_generated_config_prefix_module-balance is not set +# CONFIG_auto_generated_config_prefix_module-chassis is not set +# CONFIG_auto_generated_config_prefix_module-launcher is not set +# CONFIG_auto_generated_config_prefix_module-can_imu is not set +# CONFIG_auto_generated_config_prefix_module-wheel_leg is not set +# end of 模块 diff --git a/hw/bsp/esp32-s3-arduino/debug/launch.json b/hw/bsp/esp32-s3-arduino/debug/launch.json new file mode 100644 index 00000000..b4cdf0cc --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/debug/launch.json @@ -0,0 +1,36 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "liveWatch": { + "enabled": true, + "samplesPerSecond": 4 + }, + "configurations": [ + { + "cwd": "${workspaceRoot}", + "executable": "${workspaceRoot}/build/xrobot.elf", + "name": "Debug with OpenOCD", + "request": "launch", + "type": "cortex-debug", + "servertype": "openocd", + "configFiles": [ + "board/esp32c3-builtin.cfg" + ], + "gdbPath": "riscv32-esp-elf-gdb", + "searchDir": [], + "runToEntryPoint": "app_main", + "postLaunchCommands": [ + "mon reset halt", + "flushregs", + "mon program_esp build/bootloader/bootloader.bin 0x0 verify", + "mon program_esp build/partition_table/partition-table.bin 0x8000 verify", + "mon program_esp build/xrobot.bin 0x10000 verify", + "set remote hardware-watchpoint-limit 2", + "mon reset halt", + "flushregs" + ] + } + ] +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/CMakeLists.txt b/hw/bsp/esp32-s3-arduino/drivers/CMakeLists.txt new file mode 100644 index 00000000..1392a21d --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/CMakeLists.txt @@ -0,0 +1,35 @@ +project(bsp) + +file(GLOB ${PROJECT_NAME}_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.c") + +file(GLOB ${PROJECT_NAME}_SOURCES_CPP "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") + +add_library(${PROJECT_NAME} STATIC) + +target_sources(${PROJECT_NAME} + PRIVATE ${${PROJECT_NAME}_SOURCES} + PRIVATE ${${PROJECT_NAME}_SOURCES_CPP} +) + +include(${MCU_DIR}/default/CMakeLists.txt) + +target_link_libraries(${PROJECT_NAME} + PUBLIC idf::arduino-esp32 + PUBLIC idf::bt +) + +target_include_directories( + ${PROJECT_NAME} + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC $ + PUBLIC $ + PUBLIC $ + PUBLIC $ + PUBLIC $ + PUBLIC $ + PUBLIC $ + PUBLIC $ENV{IDF_PATH}/components/freertos/include/freertos + PUBLIC $ENV{IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos +) + +# add_dependencies(${PROJECT_NAME}) diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp.cpp b/hw/bsp/esp32-s3-arduino/drivers/bsp.cpp new file mode 100644 index 00000000..4d37dc9f --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp.cpp @@ -0,0 +1,12 @@ +#include "bsp.h" + +#include "bsp_time.h" +#include "bsp_uart.h" +#include "driver/gpio.h" + +void bsp_init() { + bsp_time_init(); + gpio_reset_pin(GPIO_NUM_8); + gpio_set_direction(GPIO_NUM_8, GPIO_MODE_OUTPUT); + bsp_uart_init(); +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp.h b/hw/bsp/esp32-s3-arduino/drivers/bsp.h new file mode 100644 index 00000000..3141bcb4 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp.h @@ -0,0 +1,18 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp_def.h" + +typedef struct { + void (*fn)(void *); + void *arg; +} bsp_callback_t; + +void bsp_init(void); + +#ifdef __cplusplus +} +#endif diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.cpp b/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.cpp new file mode 100644 index 00000000..afed0f2c --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.cpp @@ -0,0 +1,57 @@ +#include "bsp_ble_server.h" + +#include + +#include "Arduino.h" +#include "BLEDevice.h" +#include "om.h" +#include "om_fifo.h" + +#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" +#define WIFI_CONFIG_UUID "5fafc202-2fb5-469e-8fcc-c5c9c332914b" + +static om_fifo_t rx_fifo; +static uint8_t buff[100]; +static BLECharacteristic *p_wifi_config_characteristic; + +class WifiConfigCallback : public BLECharacteristicCallbacks { + void onWrite(BLECharacteristic *pCharacteristic) { + om_fifo_writes(&rx_fifo, pCharacteristic->getData(), + pCharacteristic->getLength()); + } +}; + +void bsp_ble_server_init(const char *name) { + om_fifo_create(&rx_fifo, buff, sizeof(buff), sizeof(uint8_t)); + BLEDevice::init(name); + BLEServer *p_server = BLEDevice::createServer(); + BLEService *p_service = p_server->createService(SERVICE_UUID); + p_wifi_config_characteristic = p_service->createCharacteristic( + WIFI_CONFIG_UUID, + BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE); + + p_wifi_config_characteristic->setCallbacks(new WifiConfigCallback()); + + p_service->start(); + BLEAdvertising *p_advertising = BLEDevice::getAdvertising(); + p_advertising->addServiceUUID(SERVICE_UUID); + p_advertising->setScanResponse(true); + p_advertising->setMinPreferred(0x06); + p_advertising->setMinPreferred(0x12); + + BLEDevice::startAdvertising(); +} + +uint32_t bsp_ble_server_avaliable() { + return om_fifo_readable_item_count(&rx_fifo); +} + +bsp_status_t bsp_ble_server_transmit(const uint8_t *data, size_t size) { + memcpy(buff, data, size); + p_wifi_config_characteristic->setValue(buff, size); + return BSP_OK; +} + +uint32_t bsp_ble_server_receive(uint8_t *data, size_t size) { + return om_fifo_reads(&rx_fifo, data, size) == OM_OK ? 0 : size; +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.h new file mode 100644 index 00000000..bb246ae3 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_ble_server.h @@ -0,0 +1,11 @@ +#pragma once + +#include "bsp.h" + +void bsp_ble_server_init(const char *name); + +uint32_t bsp_ble_server_avaliable(); + +bsp_status_t bsp_ble_server_transmit(const uint8_t *data, size_t size); + +uint32_t bsp_ble_server_receive(uint8_t *data, size_t size); diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.c b/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.c new file mode 100644 index 00000000..e77e5c8d --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.c @@ -0,0 +1,75 @@ +#include "bsp_flash.h" + +#include "nvs.h" +#include "nvs_flash.h" + +#define STORAGE_NAMESPACE "storage" + +bsp_status_t bsp_flash_init() { + esp_err_t err = nvs_flash_init(); + if (err == ESP_ERR_NVS_NO_FREE_PAGES || + err == ESP_ERR_NVS_NEW_VERSION_FOUND) { + // NVS partition was truncated and needs to be erased + // Retry nvs_flash_init + ESP_ERROR_CHECK(nvs_flash_erase()); + err = nvs_flash_init(); + } + ESP_ERROR_CHECK(err); + + return err == ESP_OK ? BSP_OK : BSP_ERR; +} + +size_t bsp_flash_check_blog(const char* name) { + nvs_handle_t my_handle = 0; + esp_err_t err = ESP_OK; + size_t required_size = 0; + + // Open + err = nvs_open(STORAGE_NAMESPACE, NVS_READWRITE, &my_handle); + if (err != ESP_OK) { + return err; + } + + nvs_get_blob(my_handle, name, NULL, &required_size); + + nvs_close(my_handle); + + return required_size; +} + +void bsp_flash_get_blog(const char* name, uint8_t* buff, uint32_t len) { + nvs_handle_t my_handle = 0; + esp_err_t err = ESP_OK; + + if (bsp_flash_check_blog(name) != len) { + return; + } + + // Open + err = nvs_open(STORAGE_NAMESPACE, NVS_READWRITE, &my_handle); + if (err != ESP_OK) { + return; + } + + nvs_get_blob(my_handle, name, buff, (size_t*)(&len)); + + nvs_close(my_handle); +} + +void bsp_flash_set_blog(const char* name, const uint8_t* buff, uint32_t len) { + nvs_handle_t my_handle = 0; + esp_err_t err = ESP_OK; + size_t required_size = 0; + + // Open + err = nvs_open(STORAGE_NAMESPACE, NVS_READWRITE, &my_handle); + if (err != ESP_OK) { + return; + } + + nvs_set_blob(my_handle, name, buff, len); + + err = nvs_commit(my_handle); + + nvs_close(my_handle); +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.h new file mode 100644 index 00000000..0928f152 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_flash.h @@ -0,0 +1,17 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp.h" + +bsp_status_t bsp_flash_init(); + +size_t bsp_flash_check_blog(const char* name); + +void bsp_flash_get_blog(const char* name, uint8_t* buff, uint32_t len); + +void bsp_flash_set_blog(const char* name, const uint8_t* buff, uint32_t len); + +#ifdef __cplusplus +} +#endif diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.c b/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.c new file mode 100644 index 00000000..16214d7f --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.c @@ -0,0 +1,18 @@ +#include "bsp_gpio.h" + +#include + +#include "bsp.h" +#include "driver/gpio.h" + +inline bsp_status_t bsp_gpio_write_pin(bsp_gpio_t gpio, bool value) { + switch (gpio) { + case BSP_GPIO_LED: + gpio_set_level(GPIO_NUM_8, value); + return BSP_OK; + default: + break; + } + + return BSP_ERR; +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.h new file mode 100644 index 00000000..740a31ed --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_gpio.h @@ -0,0 +1,18 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp.h" + +typedef enum { + BSP_GPIO_LED, + BSP_GPIO_NUM, +} bsp_gpio_t; + +bsp_status_t bsp_gpio_write_pin(bsp_gpio_t gpio, bool value); + +#ifdef __cplusplus +} +#endif diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_sys.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_sys.h new file mode 100644 index 00000000..bbf5558e --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_sys.h @@ -0,0 +1,32 @@ +#pragma once + +#include "bsp_def.h" +#include "esp_sleep.h" +#include "esp_system.h" +#include "portable.h" + +/* 软件复位 */ +__attribute__((always_inline, unused)) static inline void bsp_sys_reset(void) { + esp_restart(); +} + +/* 关机 */ +__attribute__((always_inline, unused)) static inline void bsp_sys_shutdown( + void) { + esp_deep_sleep_start(); +} + +/* 睡眠模式 */ +__attribute__((always_inline, unused)) static inline void bsp_sys_sleep(void) { + esp_light_sleep_start(); +} + +/* 停止模式 */ +__attribute__((always_inline, unused)) static inline void bsp_sys_stop(void) { + esp_deep_sleep_start(); +} + +/* 中断状态 */ +__attribute__((always_inline, unused)) static inline bool bsp_sys_in_isr(void) { + return xPortInIsrContext(); +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_time.c b/hw/bsp/esp32-s3-arduino/drivers/bsp_time.c new file mode 100644 index 00000000..79fa9622 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_time.c @@ -0,0 +1,26 @@ +#include "bsp_time.h" + +#include +#include + +static struct timeval start_time; + +void bsp_time_init() { gettimeofday(&start_time, NULL); } + +uint32_t bsp_time_get_ms() { + struct timeval tv; + gettimeofday(&tv, NULL); + return ((tv.tv_sec - start_time.tv_sec) * 1000 + + (tv.tv_usec - start_time.tv_usec) / 1000) % + UINT32_MAX; +} + +uint64_t bsp_time_get_us() { + struct timeval tv; + gettimeofday(&tv, NULL); + return ((tv.tv_sec - start_time.tv_sec) * 1000000 + + (tv.tv_usec - start_time.tv_usec)) % + UINT32_MAX; +} + +uint64_t bsp_time_get() __attribute__((alias("bsp_time_get_us"))); diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_time.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_time.h new file mode 100644 index 00000000..ea82bac6 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_time.h @@ -0,0 +1,19 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp.h" + +void bsp_time_init(); + +uint32_t bsp_time_get_ms(); + +uint64_t bsp_time_get_us(); + +uint64_t bsp_time_get(); + +#ifdef __cplusplus +} +#endif diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.cpp b/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.cpp new file mode 100644 index 00000000..5f55ae03 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.cpp @@ -0,0 +1,29 @@ +#include "bsp_uart.h" + +#include "Arduino.h" +#include "HardwareSerial.h" + +static size_t uart_count; + +void bsp_uart_init() { Serial1.begin(115200, SERIAL_8N1, 7, 6); } + +bsp_status_t bsp_uart_transmit(bsp_uart_t uart, uint8_t *data, size_t size, + bool block) { + (void)uart; + (void)block; + Serial1.write(data, size); + return BSP_OK; +} + +bsp_status_t bsp_uart_receive(bsp_uart_t uart, uint8_t *buff, size_t size, + bool block) { + (void)uart; + (void)block; + uart_count = Serial1.readBytes(buff, size); + return BSP_OK; +} + +uint32_t bsp_uart_get_count(bsp_uart_t uart) { + (void)uart; + return uart_count; +} diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.h new file mode 100644 index 00000000..40ba5918 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_uart.h @@ -0,0 +1,24 @@ +#include "bsp.h" + +typedef enum { + BSP_UART_MCU, + /* BSP_UART_XXX, */ + BSP_UART_NUM, + BSP_UART_ERR, +} bsp_uart_t; + +typedef enum { + BSP_UART_TX_CPLT_CB, + BSP_UART_RX_CPLT_CB, + BSP_UART_IDLE_LINE_CB, + BSP_UART_CB_NUM, +} bsp_uart_callback_t; + +void bsp_uart_init(); + +bsp_status_t bsp_uart_transmit(bsp_uart_t uart, uint8_t *data, size_t size, + bool block); +bsp_status_t bsp_uart_receive(bsp_uart_t uart, uint8_t *buff, size_t size, + bool block); + +uint32_t bsp_uart_get_count(bsp_uart_t uart); diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.cpp b/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.cpp new file mode 100644 index 00000000..5b96a8ca --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.cpp @@ -0,0 +1,31 @@ +#include "bsp_usb.h" + +#include + +#include "Arduino.h" +#include "FreeRTOS.h" +#include "HWCDC.h" +#include "task.h" + +static bool connected = false; + +bsp_status_t bsp_usb_transmit(const uint8_t *buffer, uint32_t len) { + Serial.write(buffer, len); + return BSP_OK; +} + +char bsp_usb_read_char(void) { return Serial.read(); } + +bool bsp_usb_connect(void) { + if (!connected) { + connected = Serial.available() != 0; + } + + return connected; +} + +size_t bsp_usb_avail(void) { return Serial.available(); } + +void bsp_usb_init() { Serial.begin(); } + +void bsp_usb_update() { vTaskSuspend(xTaskGetCurrentTaskHandle()); } diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.h new file mode 100644 index 00000000..6425a772 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_usb.h @@ -0,0 +1,35 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bsp.h" + +/* Exported constants ------------------------------------------------------- */ +/* Exported macro ----------------------------------------------------------- */ +/* Exported types ----------------------------------------------------------- */ + +typedef enum { + BSP_USB_CDC, + /* BSP_USB_XXX, */ + BSP_USB_NUM, + BSP_USB_ERR, +} bsp_usb_t; + +/* USB支持的中断回调函数类型 */ +typedef enum { + BSP_USB_RX_CPLT_CB, + BSP_USB_CB_NUM, +} bsp_usb_callback_t; +/* Exported functions prototypes -------------------------------------------- */ +bool bsp_usb_connect(void); /* USB已连接 */ +size_t bsp_usb_avail(void); /* USB有数据 */ +char bsp_usb_read_char(); /* 获取缓存数据 */ +size_t bsp_usb_read(uint8_t *buffer, uint32_t len); +bsp_status_t bsp_usb_transmit(const uint8_t *buffer, uint32_t len); +void bsp_usb_init(void); +void bsp_usb_update(void); +#ifdef __cplusplus +} +#endif diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.cpp b/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.cpp new file mode 100644 index 00000000..ff32ee5b --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.cpp @@ -0,0 +1,25 @@ +#include "bsp_wifi_client.h" + +#include + +#include "Arduino.h" +#include "WiFi.h" +#include "WiFiClient.h" + +static WiFiClient* wifi; + +void bsp_wifi_client_init() { wifi = new WiFiClient; } + +bsp_status_t bsp_wifi_connect(const char* name, const char* password) { + WiFi.begin(name, password); + return BSP_OK; +} + +bsp_status_t bsp_wifi_delete(const char* name) { + if (strcmp(name, WiFi.SSID().c_str()) == 0) { + WiFi.disconnect(); + } + return BSP_OK; +} + +bool bsp_wifi_connected() { return WiFi.isConnected(); } diff --git a/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.h b/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.h new file mode 100644 index 00000000..5f4952a3 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/drivers/bsp_wifi_client.h @@ -0,0 +1,11 @@ +#pragma once + +#include "bsp.h" + +void bsp_wifi_client_init(); + +bsp_status_t bsp_wifi_connect(const char* name, const char* password); + +bsp_status_t bsp_wifi_delete(const char* name); + +bool bsp_wifi_connected(); diff --git a/hw/bsp/esp32-s3-arduino/main.cpp b/hw/bsp/esp32-s3-arduino/main.cpp new file mode 100644 index 00000000..d7cb37cd --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/main.cpp @@ -0,0 +1,18 @@ +#include "FreeRTOS.h" +#include "bsp.h" +#include "robot.hpp" + +#undef LOW + +#include "Arduino.h" +#include "main.ino" + +extern "C" void app_main(void) { + initArduino(); + setup(); + bsp_init(); + robot_init(); + while (1) { + loop(); + } +} diff --git a/hw/bsp/esp32-s3-arduino/main.ino b/hw/bsp/esp32-s3-arduino/main.ino new file mode 100644 index 00000000..50e59d78 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/main.ino @@ -0,0 +1,5 @@ +#include "Arduino.h" + +void setup() {} + +void loop() { delay(1000); } diff --git a/hw/bsp/esp32-s3-arduino/sdkconfig b/hw/bsp/esp32-s3-arduino/sdkconfig new file mode 100644 index 00000000..ac3642af --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/sdkconfig @@ -0,0 +1,1787 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 + +# +# SDK tool configuration +# +CONFIG_SDK_TOOLPREFIX="xtensa-esp32s3-elf-" +# CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set +# end of SDK tool configuration + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# end of Build type + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +# +# Arduino Configuration +# +CONFIG_ARDUINO_VARIANT="esp32s3" +CONFIG_ENABLE_ARDUINO_DEPENDS=y +# CONFIG_AUTOSTART_ARDUINO is not set +CONFIG_ARDUINO_RUN_CORE0=y +# CONFIG_ARDUINO_RUN_CORE1 is not set +# CONFIG_ARDUINO_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_RUNNING_CORE=0 +CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 +CONFIG_ARDUINO_EVENT_RUN_CORE0=y +# CONFIG_ARDUINO_EVENT_RUN_CORE1 is not set +# CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_EVENT_RUNNING_CORE=0 +CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0=y +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=0 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 +CONFIG_ARDUINO_UDP_RUN_CORE0=y +# CONFIG_ARDUINO_UDP_RUN_CORE1 is not set +# CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set +CONFIG_ARDUINO_UDP_RUNNING_CORE=0 +CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 +# CONFIG_ARDUINO_ISR_IRAM is not set +# CONFIG_DISABLE_HAL_LOCKS is not set + +# +# Debug Log Configuration +# +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_NONE is not set +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR=y +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_WARN is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL=1 +# CONFIG_ARDUHAL_LOG_COLORS is not set +# CONFIG_ARDUHAL_ESP_LOG is not set +# end of Debug Log Configuration + +CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT=y +# CONFIG_ARDUHAL_PARTITION_SCHEME_MINIMAL is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_NO_OTA is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_HUGE_APP is not set +# CONFIG_ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS is not set +CONFIG_ARDUHAL_PARTITION_SCHEME="default" +# CONFIG_ARDUINO_SELECTIVE_COMPILATION is not set +# end of Arduino Configuration + +# +# Bootloader config +# +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +# CONFIG_BOOTLOADER_WDT_ENABLE is not set +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_SUPPORTS_RSA=y +CONFIG_SECURE_TARGET_HAS_SECURE_ROM_DL_MODE=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Boot ROM Behavior +# +CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y +# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set +# end of Boot ROM Behavior + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +# CONFIG_ESPTOOLPY_MONITOR_BAUD_CONSOLE is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=1 +CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +CONFIG_BT_ENABLED=y +CONFIG_BT_SOC_SUPPORT_5_0=y + +# +# Bluetooth controller +# +CONFIG_BT_CTRL_MODE_EFF=1 +CONFIG_BT_CTRL_BLE_MAX_ACT=10 +CONFIG_BT_CTRL_BLE_MAX_ACT_EFF=10 +CONFIG_BT_CTRL_BLE_STATIC_ACL_TX_BUF_NB=0 +CONFIG_BT_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BT_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BT_CTRL_PINNED_TO_CORE=0 +CONFIG_BT_CTRL_HCI_MODE_VHCI=y +# CONFIG_BT_CTRL_HCI_MODE_UART_H4 is not set +CONFIG_BT_CTRL_HCI_TL=1 +CONFIG_BT_CTRL_ADV_DUP_FILT_MAX=30 +# CONFIG_BT_CTRL_HW_CCA is not set +CONFIG_BT_CTRL_HW_CCA_VAL=20 +CONFIG_BT_CTRL_HW_CCA_EFF=0 +CONFIG_BT_CTRL_CE_LENGTH_TYPE_ORIG=y +# CONFIG_BT_CTRL_CE_LENGTH_TYPE_CE is not set +# CONFIG_BT_CTRL_CE_LENGTH_TYPE_SD is not set +CONFIG_BT_CTRL_CE_LENGTH_TYPE_EFF=0 +CONFIG_BT_CTRL_TX_ANTENNA_INDEX_0=y +# CONFIG_BT_CTRL_TX_ANTENNA_INDEX_1 is not set +CONFIG_BT_CTRL_TX_ANTENNA_INDEX_EFF=0 +CONFIG_BT_CTRL_RX_ANTENNA_INDEX_0=y +# CONFIG_BT_CTRL_RX_ANTENNA_INDEX_1 is not set +CONFIG_BT_CTRL_RX_ANTENNA_INDEX_EFF=0 +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N24 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N21 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N18 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N15 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N12 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N9 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N6 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N3 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_N0 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P3 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P6 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P9=y +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P12 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P15 is not set +# CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_P18 is not set +CONFIG_BT_CTRL_DFT_TX_POWER_LEVEL_EFF=11 +CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y +CONFIG_BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 +CONFIG_BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 +CONFIG_BT_CTRL_BLE_SCAN_DUPL=y +CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DEVICE=y +# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA is not set +# CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE is not set +CONFIG_BT_CTRL_SCAN_DUPL_TYPE=0 +CONFIG_BT_CTRL_SCAN_DUPL_CACHE_SIZE=100 +# CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN is not set +# CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EN is not set +CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_DIS=y +CONFIG_BT_CTRL_COEX_PHY_CODED_TX_RX_TLIM_EFF=0 + +# +# MODEM SLEEP Options +# +# CONFIG_BT_CTRL_MODEM_SLEEP is not set +# end of MODEM SLEEP Options + +CONFIG_BT_CTRL_SLEEP_MODE_EFF=0 +CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=0 +CONFIG_BT_CTRL_HCI_TL_EFF=1 +# CONFIG_BT_CTRL_AGC_RECORRECT_EN is not set +# CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +# end of Bluetooth controller + +CONFIG_BT_BLUEDROID_ENABLED=y +# CONFIG_BT_NIMBLE_ENABLED is not set +# CONFIG_BT_CONTROLLER_ONLY is not set + +# +# Bluedroid Options +# +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BT_BTU_TASK_STACK_SIZE=4096 +# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +CONFIG_BT_BLE_ENABLED=y +CONFIG_BT_GATTS_ENABLE=y +# CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set +# CONFIG_BT_BLE_BLUFI_ENABLE is not set +CONFIG_BT_GATT_MAX_SR_PROFILES=8 +CONFIG_BT_GATT_MAX_SR_ATTRIBUTES=100 +# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 +CONFIG_BT_GATTC_ENABLE=y +CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 +CONFIG_BT_BLE_SMP_ENABLE=y +# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_BT_STACK_NO_LOG is not set + +# +# BT DEBUG LOG LEVEL +# +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL=2 +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL=2 +# CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HID_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL=2 +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 +# end of BT DEBUG LOG LEVEL + +CONFIG_BT_ACL_CONNECTIONS=4 +CONFIG_BT_MULTI_CONNECTION_ENBALE=y +# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set +# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set +# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set +CONFIG_BT_SMP_ENABLE=y +# CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set +CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +CONFIG_BT_BLE_RPA_SUPPORTED=y +CONFIG_BT_BLE_50_FEATURES_SUPPORTED=y +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +# end of Bluedroid Options +# end of Bluetooth + +# CONFIG_BLE_MESH is not set + +# +# Driver configurations +# + +# +# ADC configuration +# +# CONFIG_ADC_FORCE_XPD_FSM is not set +CONFIG_ADC_DISABLE_DAC=y +# end of ADC configuration + +# +# MCPWM configuration +# +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# end of MCPWM configuration + +# +# SPI configuration +# +CONFIG_SPI_MASTER_IN_IRAM=y +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +CONFIG_SPI_SLAVE_IN_IRAM=y +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI configuration + +# +# TWAI configuration +# +CONFIG_TWAI_ISR_IN_IRAM=y +# end of TWAI configuration + +# +# UART configuration +# +CONFIG_UART_ISR_IN_IRAM=y +# end of UART configuration + +# +# GDMA Configuration +# +CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# end of GDMA Configuration +# end of Driver configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +CONFIG_EFUSE_MAX_BLK_LEN=256 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ESP32S3-Specific +# +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_WRAP is not set +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_WRAP is not set +# end of Cache config + +# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32S3_ULP_COPROC_ENABLED is not set +CONFIG_ESP32S3_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of ESP32S3-Specific + +# +# ADC-Calibration +# +# end of ADC-Calibration + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +# end of GDB Stub + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH=y +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_OTA_ALLOW_HTTP is not set +# end of ESP HTTPS OTA + +# +# Hardware Settings +# + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# end of MAC Config + +# +# Sleep Config +# +# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y +# end of RTC Clock Config +# end of Hardware Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 +# CONFIG_ESP_IPC_USES_CALLERS_PRIORITY is not set +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y +# end of ESP NETIF Adapter + +# +# PHY +# +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y +# end of Power Management + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP System Settings +# +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set +# CONFIG_ESP_CONSOLE_USB_CDC is not set +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_SECONDARY_NONE=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=-1 +# CONFIG_ESP_INT_WDT is not set +CONFIG_ESP_TASK_WDT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 is not set +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +# end of ESP System Settings + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=24 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=6 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +# CONFIG_ESP_WIFI_FTM_ENABLE is not set +# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +# CONFIG_FATFS_USE_FASTSEEK is not set +# end of FAT Filesystem support + +# +# FreeRTOS +# +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y +CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y +# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set +CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y +# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set +# CONFIG_FREERTOS_ASSERT_DISABLE is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y +CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y +CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y +CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER=y +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y +# CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=1 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# CONFIG_LWIP_NETIF_API is not set +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +CONFIG_LWIP_SO_RCVBUF=y +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v2.28.x related +# +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +# end of mbedTLS v2.28.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +# CONFIG_MBEDTLS_CMAC_C is not set +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +CONFIG_MBEDTLS_PSK_MODES=y +CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +CONFIG_MBEDTLS_SSL_PROTO_TLS1=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_X509_CHECK_KEY_USAGE=y +CONFIG_MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +CONFIG_MBEDTLS_RC4_DISABLED=y +# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set +# CONFIG_MBEDTLS_RC4_ENABLED is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +# CONFIG_MBEDTLS_SECURITY_RISKS is not set +# end of mbedTLS + +# +# mDNS +# +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_TASK_STACK_SIZE=4096 +# CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_MDNS_TASK_AFFINITY_CPU0=y +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x0 +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +# CONFIG_MDNS_STRICT_MODE is not set +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y +# end of mDNS + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +# end of Newlib + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# end of NVS + +# +# OpenSSL +# +# CONFIG_OPENSSL_DEBUG is not set +CONFIG_OPENSSL_ERROR_STACK=y +# CONFIG_OPENSSL_ASSERT_DO_NOTHING is not set +CONFIG_OPENSSL_ASSERT_EXIT=y +# end of OpenSSL + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set +# end of OpenThread + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +# CONFIG_SPI_FLASH_ROM_IMPL is not set +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# end of Websocket +# end of TCP Transport + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +# CONFIG_WIFI_PROV_BLE_BONDING is not set +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV is not set +# end of Wi-Fi Provisioning Manager + +# +# Supplicant +# +CONFIG_WPA_MBEDTLS_CRYPTO=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# end of Supplicant +# end of Component config + +# +# Compatibility options +# +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +# end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32s3-elf-" +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +CONFIG_FLASHMODE_QIO=y +# CONFIG_FLASHMODE_QOUT is not set +# CONFIG_FLASHMODE_DIO is not set +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set +CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=y +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=1 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BLUEDROID_ENABLED=y +# CONFIG_NIMBLE_ENABLED is not set +CONFIG_BTC_TASK_STACK_SIZE=3072 +CONFIG_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BTU_TASK_STACK_SIZE=4096 +# CONFIG_BLUEDROID_MEM_DEBUG is not set +CONFIG_GATTS_ENABLE=y +# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 +CONFIG_GATTC_ENABLE=y +# CONFIG_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BLE_SMP_ENABLE=y +# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_HCI_TRACE_LEVEL_API is not set +# CONFIG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_HCI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTM_INITIAL_TRACE_LEVEL=2 +# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 +# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 +# CONFIG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_SDP_TRACE_LEVEL_API is not set +# CONFIG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 +# CONFIG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_GAP_TRACE_LEVEL_API is not set +# CONFIG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_GAP_INITIAL_TRACE_LEVEL=2 +CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 +# CONFIG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_PAN_TRACE_LEVEL_API is not set +# CONFIG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_PAN_INITIAL_TRACE_LEVEL=2 +# CONFIG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_A2D_TRACE_LEVEL_API is not set +# CONFIG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_A2D_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 +# CONFIG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_MCA_TRACE_LEVEL_API is not set +# CONFIG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_MCA_INITIAL_TRACE_LEVEL=2 +# CONFIG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_HID_TRACE_LEVEL_API is not set +# CONFIG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_HID_INITIAL_TRACE_LEVEL=2 +# CONFIG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_APPL_TRACE_LEVEL_API is not set +# CONFIG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_APPL_INITIAL_TRACE_LEVEL=2 +# CONFIG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_GATT_TRACE_LEVEL_API is not set +# CONFIG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_GATT_INITIAL_TRACE_LEVEL=2 +# CONFIG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_SMP_TRACE_LEVEL_API is not set +# CONFIG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_SMP_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTC_INITIAL_TRACE_LEVEL=2 +# CONFIG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_OSI_TRACE_LEVEL_API is not set +# CONFIG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_OSI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set +CONFIG_SMP_ENABLE=y +# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set +CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 +CONFIG_ADC2_DISABLE_DAC=y +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_ESP_SYSTEM_PD_FLASH is not set +CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +# CONFIG_ESP32S2_PANIC_PRINT_HALT is not set +CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_ESP32S2_ALLOW_RTC_FAST_MEM_AS_HEAP=y +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +# CONFIG_CONSOLE_UART_DEFAULT is not set +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART_NUM=-1 +# CONFIG_INT_WDT is not set +CONFIG_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +# CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1 is not set +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_SW_COEXIST_ENABLE=y +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/hw/bsp/esp32-s3-arduino/toolchain.cmake b/hw/bsp/esp32-s3-arduino/toolchain.cmake new file mode 100644 index 00000000..fec37e54 --- /dev/null +++ b/hw/bsp/esp32-s3-arduino/toolchain.cmake @@ -0,0 +1,23 @@ +set(CMAKE_EXE_LINKER_FLAGS + "-Wl,--cref,--print-memory-usage,-Map=${CMAKE_PROJECT_NAME}.map" +) + +set(GENERAL_FLAGS + "-fno-exceptions -ffunction-sections -fdata-sections" + CACHE INTERNAL "" FORCE) + +set(CMAKE_C_FLAGS + " ${GENERAL_FLAGS} -fdiagnostics-color=auto" + CACHE INTERNAL "" FORCE) + +set(CMAKE_CXX_FLAGS + " ${GENERAL_FLAGS} -fno-threadsafe-statics -fno-rtti -fdiagnostics-color=auto" + CACHE INTERNAL "" FORCE) + +set(CMAKE_ASM_FLAGS + "-x assembler-with-cpp" + CACHE INTERNAL "" FORCE) + +add_link_options(-fstack-usage) + +include($ENV{IDF_PATH}/tools/cmake/toolchain-esp32s3.cmake) diff --git a/hw/mcu/esp/Shell/install_esp-idf.sh b/hw/mcu/esp/Shell/install_esp-idf.sh index c58925ea..5356a76b 100755 --- a/hw/mcu/esp/Shell/install_esp-idf.sh +++ b/hw/mcu/esp/Shell/install_esp-idf.sh @@ -5,5 +5,5 @@ cd esp git clone --depth 1 --branch v4.4.4 https://github.com/espressif/esp-idf.git cd ./esp-idf git submodule update --init --recursive --recommend-shallow --depth 1 -bash ./install.sh esp32-c3 -cd components && git clone --depth 1 --branch idf-release/v4.4 https://github.com/espressif/arduino-esp32.git --depth 1 +bash ./install.sh && rm -rf .git +cd components && git clone https://github.com/espressif/arduino-esp32.git && cd arduino-esp32 && git checkout 5bf60b74261e0eb9cd2001d46508580dd97868d4 && rm -rf .git diff --git a/project.py b/project.py index bd96c716..acc4d5ed 100755 --- a/project.py +++ b/project.py @@ -1,4 +1,4 @@ -#!python3 +#!/usr/bin/env python3 import random import sys import os diff --git a/src/component/comp_cmd.hpp b/src/component/comp_cmd.hpp index b96c9c6d..be3b97e0 100644 --- a/src/component/comp_cmd.hpp +++ b/src/component/comp_cmd.hpp @@ -9,7 +9,7 @@ class CMD { typedef enum { GIMBAL_ABSOLUTE_CTRL, GIMBAL_RELATIVE_CTRL } GimbalCommandMode; typedef enum { - CTRL_SOURCE_RC, + CTRL_SOURCE_RC, /* 键鼠控制源 */ CTRL_SOURCE_AI, CTRL_SOURCE_TERM, CTRL_SOURCE_EXT, @@ -101,6 +101,7 @@ class CMD { self_->ctrl_source_ = source; } static ControlSource GetCtrlSource() { return self_->ctrl_source_; } + static Mode GetCtrlMode() { return self_->mode_; } static bool Online() { return self_->online_; } diff --git a/src/component/comp_mixer.cpp b/src/component/comp_mixer.cpp index 301ed737..ead64bac 100644 --- a/src/component/comp_mixer.cpp +++ b/src/component/comp_mixer.cpp @@ -78,11 +78,14 @@ bool Mixer::Apply(Component::Type::MoveVector &move_vec, float *out) { out[3] = -move_vec.vx - move_vec.vy + move_vec.wz; break; case OMNIPLUS: + XB_ASSERT(this->len_ == 4); + out[0] = move_vec.vx + move_vec.wz; + out[1] = move_vec.vy + move_vec.wz; + out[2] = -move_vec.vx + move_vec.wz; + out[3] = -move_vec.vy + move_vec.wz; break; case NONE: - break; - default: break; } diff --git a/src/device/ai/dev_ai.cpp b/src/device/ai/dev_ai.cpp index 4e2fb2a8..a5b309cc 100644 --- a/src/device/ai/dev_ai.cpp +++ b/src/device/ai/dev_ai.cpp @@ -16,10 +16,11 @@ static uint8_t txbuf[AI_LEN_TX_BUFF]; using namespace Device; -AI::AI() - : data_ready_(false), +AI::AI(bool autoscan_enable) + : autoscan_enable_(autoscan_enable), event_(Message::Event::FindEvent("cmd_event")), - cmd_tp_("cmd_ai") { + cmd_tp_("cmd_ai"), + data_ready_(false) { auto rx_cplt_callback = [](void *arg) { AI *ai = static_cast(arg); ai->data_ready_.Post(); @@ -34,29 +35,37 @@ AI::AI() auto quat_sub = Message::Subscriber("imu_quat"); auto ref_sub = Message::Subscriber("referee"); + auto gimbal_sub = Message::Subscriber("gimbal_data"); + + auto eulr_sub = Message::Subscriber("imu_eulr"); while (1) { - /* 接收指令 */ - ai->StartRecv(); + /* 接收云台数据 */ + gimbal_sub.DumpData(ai->chassis_yaw_offset_); + eulr_sub.DumpData(ai->eulr_); /* imu */ + /* 接收裁判系统数据 */ + if (ref_sub.DumpData(ai->raw_ref_)) { + ai->PraseRef(); + ai->PackRef(); + } + /* 接收上位机数据 */ + ai->StartRecv(); if (ai->data_ready_.Wait(0)) { ai->PraseHost(); } else { ai->Offline(); } - /* 发布控制命令 */ + /* 决策与命令发布 */ + ai->DecideAction(); ai->PackCMD(); + ai->ai_tp_.Publish(ai->cmd_for_ref_); /* 发送数据到上位机 */ quat_sub.DumpData(ai->quat_); ai->PackMCU(); - if (ref_sub.DumpData(ai->raw_ref_)) { - ai->PraseRef(); - ai->PackRef(); - } - ai->StartTrans(); System::Thread::Sleep(2); @@ -101,7 +110,11 @@ bool AI::Offline() { /* 离线移交控制权 */ if (bsp_time_get_ms() - this->last_online_time_ > 200) { memset(&this->cmd_, 0, sizeof(cmd_)); - this->cmd_.online = false; + if (!this->autoscan_enable_) { + this->cmd_.online = true; + } else { + this->cmd_.online = false; + } this->cmd_.ctrl_source = Component::CMD::CTRL_SOURCE_AI; this->cmd_tp_.Publish(this->cmd_); } @@ -112,6 +125,7 @@ bool AI::PackMCU() { this->to_host_.mcu.id = AI_ID_MCU; memcpy(&(this->to_host_.mcu.package.data.quat), &(this->quat_), sizeof(this->quat_)); + this->to_host_.mcu.package.data.notice = this->notice_for_ai_; this->to_host_.mcu.package.crc16 = Component::CRC16::Calculate( reinterpret_cast(&(this->to_host_.mcu.package)), sizeof(this->to_host_.mcu.package) - sizeof(uint16_t), CRC16_INIT); @@ -135,50 +149,208 @@ bool AI::PackRef() { return true; } -bool AI::PackCMD() { +void AI::DecideAction() { memcpy(&(this->cmd_.gimbal.eulr), &(this->from_host_.data.gimbal), sizeof(this->cmd_.gimbal.eulr)); + this->notice_ = this->from_host_.data.notice; + /* AI自瞄数据不更新,重置notice_ */ + // TODO:检测更新方式不合理 + if (this->cmd_.gimbal.eulr.yaw == this->last_auto_aim_eulr_.yaw || + this->cmd_.gimbal.eulr.pit == this->last_auto_aim_eulr_.pit) { + this->notice_ = 0; + } else { + this->aim_time_ = bsp_time_get_ms(); /* 自瞄锁定时刻 */ + } + memcpy(&(this->last_auto_aim_eulr_), &(this->cmd_.gimbal.eulr), + sizeof(this->cmd_.gimbal.eulr)); - memcpy(&(this->cmd_.ext.extern_channel), - &(this->from_host_.data.extern_channel), - sizeof(this->cmd_.ext.extern_channel)); + /* 判定是否受击打,一定时间内第一次受击打方向优先级最高 */ + if (this->raw_ref_.robot_damage.damage_type == 0x0 && + (this->raw_ref_.robot_damage.damage_type != damage_.type_) && + (damage_.is_damaged_ == false)) { + this->damage_.is_damaged_ = true; + this->damage_.id_ = this->raw_ref_.robot_damage.armor_id; + this->damage_.yaw_offset_ = this->chassis_yaw_offset_; + this->damage_.gimbal_yaw_ = this->eulr_.yaw; + this->damage_.time_ = bsp_time_get_ms(); + } + if (bsp_time_get_ms() - this->damage_.time_ > 1500) { + this->damage_.is_damaged_ = false; + } - memcpy(&(this->cmd_.chassis), &(this->from_host_.data.chassis_move_vec), - sizeof(this->from_host_.data.chassis_move_vec)); + /* 判定是否可以开始导航 */ + if (this->from_host_.data.chassis_move_vec.vx == 0 && damage_.is_damaged_) { + navigation_enable_ = false; + } else { + navigation_enable_ = true; + } - this->notice_ = this->from_host_.data.notice; + /* 裁判系统行为:确认复活、购买发弹量 */ + if (this->ref_.hp == 0) { + this->action_.ai_to_referee = CONFIRM_RESURRECTION; + } else if (this->ref_.bullet_num == 0 && this->ref_.coin_num > 200) { + this->action_.ai_to_referee = EXCHANGE_BULLETS; + } else { + this->action_.ai_to_referee = NOTHING; + } - memcpy(&(this->last_eulr_), &(this->cmd_.gimbal.eulr), - sizeof(this->cmd_.gimbal.eulr)); + /* 底盘行为*/ + if (navigation_enable_) { + if (this->ref_.outpost_hp > 200) { /* 认为哨兵&基地无敌 */ + this->action_.ai_chassis = AI::Action::TO_HIGHWAY; + this->notice_for_ai_ = AI::Action::TO_HIGHWAY; + } else { + if (this->ref_.hp < 100 || + (this->action_.ai_to_referee == EXCHANGE_BULLETS)) { /* max = 400 */ + this->action_.ai_chassis = AI::Action::TO_SUPPLY; + this->notice_for_ai_ = AI::Action::TO_SUPPLY; + } else { + this->action_.ai_chassis = AI::Action::TO_PATROL_AREA; + this->notice_for_ai_ = AI::Action::TO_PATROL_AREA; + } + } + } else { + this->action_.ai_chassis = AI::Action::ROTOR; + } - this->cmd_.ctrl_source = Component::CMD::CTRL_SOURCE_AI; + /* 云台行为 */ + if (this->notice_ == AI_NOTICE_AUTO_AIM || this->notice_ == AI_NOTICE_FIRE || + bsp_time_get_ms() - this->aim_time_ < 1000) { + /* 自瞄/丢失目标1000ms内,进行视觉暂留 */ + this->action_.ai_gimbal = AI::Action::AUTO_AIM; + this->cmd_.gimbal.mode = Component::CMD::GIMBAL_ABSOLUTE_CTRL; + } else if (damage_.is_damaged_) { + this->cmd_.gimbal.mode = Component::CMD::GIMBAL_ABSOLUTE_CTRL; + this->action_.ai_gimbal = AI::Action::AFFECTED; + } else { + this->cmd_.gimbal.mode = Component::CMD::GIMBAL_ABSOLUTE_CTRL; + this->action_.ai_gimbal = AI::Action::SCANF; + } - this->cmd_tp_.Publish(this->cmd_); + /* 发射机构行为 */ + if (this->notice_ == AI_NOTICE_FIRE) { /* 开火 */ + this->action_.ai_launcher = AI::Action::FIRE; + } else { + this->action_.ai_launcher = AI::Action::CEASEFIRE; /* 不发弹 */ + } +} +bool AI::PackCMD() { + /* 确保遥控器开关最高控制权,关遥控器即断控 */ if (!Component::CMD::Online()) { return false; } - /* 控制权在AI */ + /* 控制源:AI */ if (Component::CMD::GetCtrlSource() == Component::CMD::CTRL_SOURCE_AI) { - if (this->cmd_.online) { - if (this->notice_ == AI_NOTICE_AUTO_AIM) { - this->cmd_.gimbal.mode = Component::CMD::GIMBAL_ABSOLUTE_CTRL; - this->event_.Active(AI_FIND_TARGET); - } else if (this->notice_ == AI_NOTICE_FIRE) { - this->cmd_.gimbal.mode = Component::CMD::GIMBAL_ABSOLUTE_CTRL; - this->event_.Active(AI_FIND_TARGET); - this->event_.Active(AI_FIRE_COMMAND); - } else { - this->event_.Active(AI_AUTOPATROL); + /* AUTO控制模式,用于全自动机器人 */ + if (Component::CMD::GetCtrlMode() == Component::CMD::CMD_AUTO_CTRL) { + switch (this->action_.ai_chassis) { + case TO_PATROL_AREA: + case TO_HIGHWAY: + case TO_OUTPOST: + case TO_SUPPLY: + memcpy(&(this->cmd_.chassis), + &(this->from_host_.data.chassis_move_vec), + sizeof(this->from_host_.data.chassis_move_vec)); + break; + case ROTOR: + this->event_.Active(AI_ROTOR); + break; + } + + switch (this->action_.ai_gimbal) { + case AUTO_AIM: + memcpy(&(this->cmd_.gimbal.eulr), &(this->from_host_.data.gimbal), + sizeof(this->cmd_.gimbal.eulr)); + break; + case AFFECTED: + this->cmd_.gimbal.eulr.yaw = this->damage_.gimbal_yaw_ + + this->damage_.id_ * (M_2PI / 4.0) - + this->damage_.yaw_offset_; + this->cmd_.gimbal.eulr.pit = 0.0f; + this->gimbal_scan_start_angle_ = + this->eulr_.yaw; /* 更新yaw扫描的起始位置 */ + this->target_scan_angle_ = 0.0; /* 置零yaw扫描的位置增量 */ + break; + case SCANF: + this->target_scan_angle_ += this->scanf_mode_.scanf_yaw_rate; + this->cmd_.gimbal.eulr.yaw = + this->target_scan_angle_ + this->gimbal_scan_start_angle_; + this->cmd_.gimbal.eulr.pit = + this->scanf_mode_.scanf_pit_center + + this->scanf_mode_.scanf_pit_range * + sinf(this->scanf_mode_.scanf_pit_omega * + static_cast(bsp_time_get_ms()) / 1000.0f); + break; + } + + switch (this->action_.ai_launcher) { + case FIRE: + this->event_.Active(AI_FIRE_COMMAND); /* 发弹指令,采用连发模式 */ + break; + case CEASEFIRE: + this->event_.Active(AI_STOP_FIRE); + break; + } + + switch (this->action_.ai_to_referee) { + case CONFIRM_RESURRECTION: + cmd_for_ref_.confirm_resurrection = 1; + cmd_for_ref_.buy_resurrection = 0; + cmd_for_ref_.buy_bullet_num = 0; + cmd_for_ref_.remote_buy_bullet_times = 0; + cmd_for_ref_.romote_buy_hp_times = 0; + break; + case EXCHANGE_BULLETS: + cmd_for_ref_.confirm_resurrection = 0; + cmd_for_ref_.buy_resurrection = 0; + cmd_for_ref_.buy_bullet_num = this->last_buy_bullet_num_ + 50; + cmd_for_ref_.remote_buy_bullet_times = 0; + cmd_for_ref_.romote_buy_hp_times = 0; + break; + case NOTHING: + cmd_for_ref_.confirm_resurrection = 0; + cmd_for_ref_.buy_resurrection = 0; + cmd_for_ref_.buy_bullet_num = this->last_buy_bullet_num_; + cmd_for_ref_.remote_buy_bullet_times = 0; + cmd_for_ref_.romote_buy_hp_times = 0; + break; + } + this->last_buy_bullet_num_ = cmd_for_ref_.buy_bullet_num; + + /* 比赛开始前不运行 */ + if (this->ref_.game_progress == GAMING || + this->ref_.game_progress == PREPARATION || + this->ref_.game_progress == WAITTING) { + this->cmd_tp_.Publish(this->cmd_); } - } else { - this->event_.Active(AI_OFFLINE); } - } + /* OP控制模式,用于鼠标右键自瞄 */ + else if (Component::CMD::GetCtrlMode() == Component::CMD::CMD_OP_CTRL) { + memcpy(&(this->cmd_.gimbal.eulr), &(this->from_host_.data.gimbal), + sizeof(this->cmd_.gimbal.eulr)); + + memcpy(&(this->cmd_.ext.extern_channel), + &(this->from_host_.data.extern_channel), + sizeof(this->cmd_.ext.extern_channel)); + + memcpy(&(this->cmd_.chassis), &(this->from_host_.data.chassis_move_vec), + sizeof(this->from_host_.data.chassis_move_vec)); - this->notice_ = 0; + memcpy(&(this->cmd_.ext.extern_channel), + &(this->from_host_.data.extern_channel), + sizeof(this->cmd_.ext.extern_channel)); + this->notice_ = this->from_host_.data.notice; + + this->cmd_.ctrl_source = Component::CMD::CTRL_SOURCE_AI; + + this->cmd_tp_.Publish(this->cmd_); + this->cmd_tp_.Publish(this->cmd_); + this->cmd_tp_.Publish(this->cmd_); + } + } return true; } @@ -245,4 +417,29 @@ void AI::PraseRef() { default: this->ref_.robot_id = AI_ARM_INFANTRY; } + + this->ref_.game_progress = this->raw_ref_.game_status.game_progress; + + if (this->raw_ref_.robot_status.robot_id < 100) { + this->ref_.base_hp = this->raw_ref_.game_robot_hp.red_base; + this->ref_.outpost_hp = this->raw_ref_.game_robot_hp.red_outpose; + this->ref_.own_virtual_shield_value = + this->raw_ref_.field_event.virtual_shield_value; + } else { + this->ref_.base_hp = this->raw_ref_.game_robot_hp.blue_base; + this->ref_.outpost_hp = this->raw_ref_.game_robot_hp.blue_outpose; + this->ref_.own_virtual_shield_value = + this->raw_ref_.field_event.virtual_shield_value; + } + this->ref_.coin_num = this->raw_ref_.bullet_remain.coin_remain; + this->ref_.pos_x = this->raw_ref_.robot_pos.x; + this->ref_.pos_y = this->raw_ref_.robot_pos.y; + this->ref_.pos_angle = this->raw_ref_.robot_pos.angle; + + this->ref_.target_pos_x = this->raw_ref_.client_map.position_x; + this->ref_.target_pos_y = this->raw_ref_.client_map.position_y; + + if (this->raw_ref_.robot_damage.damage_type == 0) { + this->ref_.damaged_armor_id = this->raw_ref_.robot_damage.armor_id; + } } diff --git a/src/device/ai/dev_ai.hpp b/src/device/ai/dev_ai.hpp index bdbc56a6..8f25773d 100644 --- a/src/device/ai/dev_ai.hpp +++ b/src/device/ai/dev_ai.hpp @@ -29,17 +29,81 @@ class AI { uint32_t ball_speed; uint32_t max_hp; uint32_t hp; + + uint8_t game_progress; + uint16_t base_hp; + uint16_t outpost_hp; + uint16_t bullet_num; + uint16_t coin_num; + uint8_t own_virtual_shield_value; + float pos_x; + float pos_y; + float pos_angle; + float target_pos_x; + float target_pos_y; + uint8_t damaged_armor_id; } RefForAI; + typedef struct { + float scanf_yaw_rate; + float scanf_pit_center; + float scanf_pit_range; + float scanf_pit_omega; + } ScanfMode; + typedef enum { - AI_OFFLINE = 128, - AI_FIND_TARGET, - AI_AUTOPATROL, - AI_TURN, + AI_OFFLINE = 127, + AI_INDENPENDENT, + AI_FOLLOW, + AI_ROTOR, AI_FIRE_COMMAND, + AI_STOP_FIRE, } AIControlData; - AI(); + typedef enum { + WAITTING = 0, + PREPARATION = 1, + REF_INSPECTION = 2, + COUNTDOWN_5S = 3, + GAMING = 4, + GAME_END = 5, + } GameProgress; + typedef enum { + TO_PATROL_AREA = 0, /* 哨兵巡逻区 */ + TO_SUPPLY = 1, /* 补给区 */ + TO_HIGHWAY = 2, /* 公路区 */ + TO_OUTPOST = 3, /* 前哨站 */ + ROTOR = 4, + + SCANF = 5, + AUTO_AIM = 6, + AFFECTED = 7, /* 反击*/ + + CEASEFIRE = 8, /* 停火 */ + FIRE = 9, + + NOTHING = 10, + CONFIRM_RESURRECTION = 11, /* 确认复活 */ + EXCHANGE_BULLETS = 12, /* 兑换弹丸 */ + /* 其他行为暂不考虑 */ + } Action; + + typedef struct __attribute__((packed)) { + uint32_t confirm_resurrection : 1; + uint32_t buy_resurrection : 1; + uint32_t buy_bullet_num : 11; + uint32_t remote_buy_bullet_times : 4; + uint32_t romote_buy_hp_times : 4; + uint32_t res : 11; + } SentryDecisionData; + typedef struct { + uint8_t ai_chassis; /* 小陀螺、导航 */ + uint8_t ai_gimbal; /* 扫描、自瞄、反击 */ + uint8_t ai_launcher; /* 不发弹丸、开火 */ + uint8_t ai_to_referee; /* 确认复活、购买发弹量、购买血量 */ + } AICtrlAction; + + AI(bool autoscan_enable = false); bool StartRecv(); @@ -57,39 +121,84 @@ class AI { bool PackCMD(); + void DecideAction(); + private: + /* function */ + bool autoscan_enable_ = true; /* AI自动扫描,不启用则默认AI全程在线 */ + + /* run status */ + bool navigation_enable_ = 0; bool ref_updated_ = false; + uint8_t last_buy_bullet_num_ = 0; + /* time record */ uint32_t last_online_time_ = 0; + uint32_t aim_time_; + + /* angle record */ + float chassis_yaw_offset_ = 0; + float gimbal_scan_start_angle_; + Component::Type::Eulr eulr_; + Component::Type::Quaternion quat_; + Component::Type::CycleValue target_scan_angle_ = 0.0; + struct { + float yaw; /* 偏航角(Yaw angle) */ + float pit; /* 俯仰角(Pitch angle) */ + float rol; /* 翻滚角(Roll angle) */ + } last_auto_aim_eulr_; - Protocol_DownPackage_t from_host_{}; - + /* notice */ uint8_t notice_; + uint8_t notice_for_ai_; + + /* Damage Status */ + struct { + uint8_t type_; + bool is_damaged_; + uint8_t id_; + uint32_t time_; + Component::Type::CycleValue yaw_offset_; + Component::Type::CycleValue gimbal_yaw_; + } damage_; + + /* Data */ + Protocol_DownPackage_t from_host_{}; struct { RefereePckage ref{}; MCUPckage mcu{}; } to_host_; - RefForAI ref_{}; + RefForAI ref_; - System::Thread thread_; + Component::CMD::Data cmd_{}; - System::Semaphore data_ready_; + AICtrlAction action_; + + ScanfMode scanf_mode_ = { + .scanf_yaw_rate = 0.0025f, + .scanf_pit_center = 0.04f, + .scanf_pit_range = 0.22f, + .scanf_pit_omega = 5.0f, + }; + + SentryDecisionData cmd_for_ref_; + + /* Topic & Event */ Message::Event event_; Message::Topic cmd_tp_; - Component::CMD::Data cmd_{}; + Message::Topic ai_tp_ = + Message::Topic("sentry_cmd_for_ref"); - struct { - float yaw; /* 偏航角(Yaw angle) */ - float pit; /* 俯仰角(Pitch angle) */ - float rol; /* 翻滚角(Roll angle) */ - } last_eulr_; - - Component::Type::Quaternion quat_{}; Device::Referee::Data raw_ref_{}; + + /* Task Control */ + System::Thread thread_; + + System::Semaphore data_ready_; }; } // namespace Device diff --git a/src/device/referee/dev_referee.cpp b/src/device/referee/dev_referee.cpp index 5f200910..29159e96 100644 --- a/src/device/referee/dev_referee.cpp +++ b/src/device/referee/dev_referee.cpp @@ -37,6 +37,8 @@ using namespace Device; static uint8_t rxbuf[REF_LEN_RX_BUFF]; Referee::UIPack Referee::ui_pack_; +Referee::SentryPack Referee::sentry_pack_; + Referee *Referee::self_; Referee::Referee() : event_(Message::Event::FindEvent("cmd_event")) { @@ -97,11 +99,13 @@ Referee::Referee() : event_(Message::Event::FindEvent("cmd_event")) { this->recv_thread_.Create(ref_recv_thread, this, "ref_recv_thread", DEVICE_REF_RECV_TASK_STACK_DEPTH, System::Thread::REALTIME); + auto ref_trans_thread = [](Referee *ref) { uint32_t last_online_time = bsp_time_get_ms(); - + auto ai_sub = Message::Subscriber("sentry_cmd_for_ref"); while (1) { - ref->UpdateUI(); + ai_sub.DumpData(ref->data_from_sentry_); + ref->Update(); /* 更新UI */ ref->trans_thread_.SleepUntil(40, last_online_time); } }; @@ -309,7 +313,7 @@ void Referee::Prase() { memset(rxbuf, 0, data_length); } -bool Referee::UpdateUI() { +bool Referee::Update() { this->packet_sent_.Wait(UINT32_MAX); this->ui_lock_.Wait(UINT32_MAX); @@ -318,6 +322,7 @@ bool Referee::UpdateUI() { uint32_t ele_counter = 0; uint32_t pack_size = 0; CMDID cmd_id = REF_STDNT_CMD_ID_UI_DEL; + Component::UI::GraphicOperation op = Component::UI::UI_GRAPHIC_OP_NOTHING; if (!done && this->static_del_data_.Size() > 0) { @@ -436,7 +441,7 @@ bool Referee::UpdateUI() { return false; } - this->ui_pack_.raw.cmd_id = REF_CMD_ID_INTER_STUDENT; + this->ui_pack_.raw.cmd_id = REF_CMD_ID_INTER_STUDENT; /* 0x0301 */ SetUIHeader(this->ui_pack_.raw.student_header, cmd_id, static_cast(this->ref_data_.robot_status.robot_id)); @@ -530,6 +535,17 @@ void Referee::SetUIHeader(Referee::InterStudentHeader &header, header.id_receiver = robot_id + 0x0100; } } +void Referee::SetSentryHeader(Referee::InterStudentHeader &header, + const Referee::CMDID CMD_ID, + Referee::RobotID robot_id) { + header.cmd_id = CMD_ID; + if (robot_id > 100) { + header.id_sender = 0x0107; + } else { + header.id_sender = 0x0007; + } + header.id_receiver = 0x8080; +} void Referee::SetPacketHeader(Referee::Header &header, uint16_t data_length) { static uint8_t seq = 0; diff --git a/src/device/referee/dev_referee.hpp b/src/device/referee/dev_referee.hpp index a7a76e12..304b509f 100644 --- a/src/device/referee/dev_referee.hpp +++ b/src/device/referee/dev_referee.hpp @@ -1,6 +1,6 @@ /* 裁判系统抽象。 - 2024_03_21 已修改。 + 2024_05_04 已更新至1.6.2版。 */ #pragma once @@ -76,11 +76,11 @@ class Referee { REF_CMD_ID_RADAR_MARK = 0X020C, REF_CMD_ID_SENTRY_DECISION = 0x020D, /* 哨兵自主决策相关信息同步 */ REF_CMD_ID_RADAR_DECISION = 0x020E, /* 雷达自主决策相关信息同步 */ - REF_CMD_ID_INTER_STUDENT = 0x0301, - REF_CMD_ID_INTER_STUDENT_CUSTOM = 0x0302, + REF_CMD_ID_INTER_STUDENT = 0x0301, /* 机器人交互数据 */ + REF_CMD_ID_INTER_STUDENT_CUSTOM = 0x0302, /* 自定义控制器和机器人 */ REF_CMD_ID_CLIENT_MAP = 0x0303, REF_CMD_ID_KEYBOARD_MOUSE = 0x0304, - REF_CMD_ID_MAP_ROBOT_DATA = 0x0305, // 0x0305 + REF_CMD_ID_MAP_ROBOT_DATA = 0x0305, REF_CMD_ID_CUSTOM_KEYBOARD_MOUSE = 0X0306, REF_CMD_ID_SENTRY_POS_DATA = 0x0307, REF_CMD_ID_ROBOT_POS_DATA = 0x0308, /* 选手端小地图接受机器人消息 */ @@ -288,11 +288,11 @@ class Referee { uint8_t res : 5; } RadarInfo; /* 0x020E */ typedef struct __attribute__((packed)) { - uint16_t data_cmd_id; + uint16_t data_cmd_id; /* 子内容ID */ uint16_t sender_id; uint16_t receiver_id; - std::array user_data; - /*最大值113*/ + std::array user_data; + /*最大值112*/ } RobotInteractionData; /* 0x0301 */ typedef struct __attribute__((packed)) { @@ -355,7 +355,10 @@ class Referee { REF_BOT_RED_INFANTRY_3 = 5, REF_BOT_RED_DRONE = 6, REF_BOT_RED_SENTRY = 7, + REF_BOT_RED_DART = 8, REF_BOT_RED_RADER = 9, + REF_BOT_RED_OUTPOST = 10, + REF_BOT_RED_BASE = 11, REF_BOT_BLU_HERO = 101, REF_BOT_BLU_ENGINEER = 102, REF_BOT_BLU_INFANTRY_1 = 103, @@ -363,7 +366,10 @@ class Referee { REF_BOT_BLU_INFANTRY_3 = 105, REF_BOT_BLU_DRONE = 106, REF_BOT_BLU_SENTRY = 107, + REF_BOT_BLU_DART = 108, REF_BOT_BLU_RADER = 109, + REF_BOT_BLU_OUTPOST = 110, + REF_BOT_BLU_BASE = 111, } RobotID; typedef enum { @@ -379,7 +385,8 @@ class Referee { REF_CL_BLU_INFANTRY_2 = 0x0168, REF_CL_BLU_INFANTRY_3 = 0x0169, REF_CL_BLU_DRONE = 0x016A, - } ClientID; + REF_CL_REFEREE_SERVER = 0x8080, /* 裁判系统服务器,用于哨兵和雷达自主决策 */ + } ClientID; /* 子内容ID */ typedef enum { REF_STDNT_CMD_ID_UI_DEL = 0x0100, @@ -389,8 +396,8 @@ class Referee { REF_STDNT_CMD_ID_UI_DRAW7 = 0x0104, REF_STDNT_CMD_ID_UI_STR = 0x0110, REF_STDNT_CMD_ID_CUSTOM = 0x0200, - REF_STDNT_CMD_ID_SENTRY_COMMAND = 0X0120, - REF_STDNT_CMD_ID_RADAR_COMMAND = 0X0121, + REF_STDNT_CMD_ID_SENTRY_CMD = 0X0120, + REF_STDNT_CMD_ID_RADAR_CMD = 0X0121, } CMDID; typedef struct __attribute__((packed)) { @@ -487,10 +494,35 @@ class Referee { struct __attribute__((packed)) { Header frame_header; uint16_t cmd_id; - Referee::InterStudentHeader student_header; + Referee::InterStudentHeader student_header; //字命令、发送者、接受者 } raw; }; + typedef struct __attribute__((packed)) { + uint32_t confirm_resurrection : 1; + uint32_t buy_resurrection : 1; + uint32_t buy_bullet_num : 11; + uint32_t remote_buy_bullet_times : 4; + uint32_t romote_buy_hp_times : 4; + uint32_t res : 11; + } SentryDecisionData; + + typedef struct __attribute__((packed)) { + Header frame_header; // 0x0301 + uint16_t cmd_id; + Referee::InterStudentHeader student_header; //含0x0120 + uint32_t data_cmd; + uint16_t crc16; + } SentryPack; + + typedef struct __attribute__((packed)) { + Header frame_header; + uint16_t cmd_id; + Referee::InterStudentHeader student_header; + uint8_t radar_cmd; + uint16_t crc16; + } RadarPack; + Referee(); bool UIStackEmpty(); @@ -501,7 +533,7 @@ class Referee { void Prase(); - bool UpdateUI(); + bool Update(); static bool AddUI(Component::UI::Ele ui_data); static bool AddUI(Component::UI::Del ui_data); @@ -516,6 +548,8 @@ class Referee { void SetUIHeader(InterStudentHeader &header, const CMDID CMD_ID, RobotID robot_id); + void SetSentryHeader(InterStudentHeader &header, const CMDID CMD_ID, + RobotID robot_id); void SetPacketHeader(Referee::Header &header, uint16_t data_length); @@ -546,8 +580,13 @@ class Referee { System::Queue static_del_data_ = System::Queue(10); + System::Queue sentry_data_ = + System::Queue(10); + System::Semaphore ui_lock_ = System::Semaphore(true); + System::Semaphore sentry_lock_ = System::Semaphore(true); + Data ref_data_; Data last_data_; @@ -556,6 +595,9 @@ class Referee { static UIPack ui_pack_; + static SentryPack sentry_pack_; + static Referee *self_; + SentryDecisionData data_from_sentry_; }; } // namespace Device diff --git a/src/module/chassis/mod_chassis.cpp b/src/module/chassis/mod_chassis.cpp index f4c8c190..ffad075c 100644 --- a/src/module/chassis/mod_chassis.cpp +++ b/src/module/chassis/mod_chassis.cpp @@ -95,7 +95,7 @@ Chassis::Chassis(Param& param, float control_freq) auto cmd_sub = Message::Subscriber("cmd_chassis"); - auto yaw_sub = Message::Subscriber("chassis_yaw"); + auto yaw_sub = Message::Subscriber("gimbal_data"); auto cap_sub = Message::Subscriber("cap_info"); @@ -105,7 +105,7 @@ Chassis::Chassis(Param& param, float control_freq) /* 读取控制指令、电容、裁判系统、电机反馈 */ cmd_sub.DumpData(chassis->cmd_); raw_ref_sub.DumpData(chassis->raw_ref_); - yaw_sub.DumpData(chassis->yaw_); + yaw_sub.DumpData(chassis->gimbal_data_); cap_sub.DumpData(chassis->cap_); /* 更新反馈值 */ @@ -163,7 +163,7 @@ void Chassis::Control() { case Chassis::FOLLOW_GIMBAL: /* 按照云台方向换算运动向量 */ case Chassis::ROTOR: { - float beta = this->yaw_; + float beta = this->gimbal_data_.yaw_; float cos_beta = cosf(beta); float sin_beta = sinf(beta); this->move_vec_.vx = cos_beta * this->cmd_.x - sin_beta * this->cmd_.y; @@ -185,7 +185,7 @@ void Chassis::Control() { case Chassis::FOLLOW_GIMBAL: /* 跟随模式通过PID控制使车头跟随云台 */ this->move_vec_.wz = - this->follow_pid_.Calculate(0.0f, this->yaw_, this->dt_); + this->follow_pid_.Calculate(0.0f, this->gimbal_data_.yaw_, this->dt_); break; case Chassis::ROTOR: { /* 小陀螺模式使底盘以一定速度旋转 @@ -222,11 +222,11 @@ void Chassis::Control() { clampf(&percentage, 0.0f, 1.0f); for (unsigned i = 0; i < this->mixer_.len_; i++) { - float out = this->actuator_[i]->Calculate( + out_.motor3508_out[i] = this->actuator_[i]->Calculate( this->setpoint_.motor_rotational_speed[i] * MOTOR_MAX_ROTATIONAL_SPEED, this->motor_[i]->GetSpeed(), this->dt_); - this->motor_[i]->Control(out * percentage); + this->motor_[i]->Control(out_.motor3508_out[i]); } break; diff --git a/src/module/chassis/mod_chassis.hpp b/src/module/chassis/mod_chassis.hpp index f5f435c4..ecb110dd 100644 --- a/src/module/chassis/mod_chassis.hpp +++ b/src/module/chassis/mod_chassis.hpp @@ -43,6 +43,11 @@ class Chassis { SET_MODE_INDENPENDENT, } ChassisEvent; + typedef struct { + float yaw_; + Component::Type::Eulr mech_zero; + } GimbalData; + /* 底盘参数的结构体,包含所有初始Component化用的参数,通常是const,存好几组 */ typedef struct Param { Component::Mixer::Mode type = @@ -115,14 +120,18 @@ class Chassis { /* 反馈控制用的PID */ + struct { + float motor3508_out[4]; + } out_; Component::PID follow_pid_; /* 跟随云台用的PID */ System::Thread thread_; System::Semaphore ctrl_lock_; - float yaw_; + GimbalData gimbal_data_; Device::Referee::Data raw_ref_; + Component::CMD::ChassisCMD cmd_; Component::UI::String string_; diff --git a/src/module/gimbal/mod_gimbal.cpp b/src/module/gimbal/mod_gimbal.cpp index f7e76372..b0b494c8 100644 --- a/src/module/gimbal/mod_gimbal.cpp +++ b/src/module/gimbal/mod_gimbal.cpp @@ -33,9 +33,6 @@ Gimbal::Gimbal(Param& param, float control_freq) case STOP_AUTO_AIM: Component::CMD::SetCtrlSource(Component::CMD::CTRL_SOURCE_RC); break; - case SET_AUTOPATROL: - gimbal->SetMode(static_cast(AUTOPATROL)); - break; } gimbal->ctrl_lock_.Post(); }; @@ -81,21 +78,8 @@ Gimbal::Gimbal(Param& param, float control_freq) void Gimbal::UpdateFeedback() { this->pit_motor_.Update(); this->yaw_motor_.Update(); - switch (this->mode_) { - case RELAX: - case ABSOLUTE: - this->yaw_ = this->yaw_motor_.GetAngle() - this->param_.mech_zero.yaw; - break; - case AUTOPATROL: - this->yaw_ = this->yaw_motor_.GetAngle() - this->param_.mech_zero.yaw - - this->param_.patrol_range * - sinf(this->param_.patrol_omega * - static_cast(bsp_time_get_ms() - - autopatrol_start_time_) / - 1000.0f); - break; - } + this->yaw_ = this->yaw_motor_.GetAngle() - this->param_.mech_zero.yaw; } void Gimbal::Control() { @@ -118,7 +102,6 @@ void Gimbal::Control() { gimbal_pit_cmd = Component::Type::CycleValue(this->cmd_.eulr.pit) - this->setpoint_.eulr_.pit; } - /* 处理yaw控制命令,软件限位 */ /* 某个轴max=min时不进行限位,配置文件默认不写 */ if (param_.limit.yaw_max != param_.limit.yaw_min) { @@ -149,7 +132,6 @@ void Gimbal::Control() { /* 控制相关逻辑 */ float yaw_out = 0; float pit_out = 0; - float autopatrol_yaw = 0; switch (this->mode_) { case RELAX: this->yaw_motor_.Relax(); @@ -167,24 +149,6 @@ void Gimbal::Control() { this->pit_motor_.Control(pit_out); break; - - case AUTOPATROL: - /* 以sin变化左右摆头 */ - autopatrol_yaw = this->setpoint_.eulr_.yaw + - this->param_.patrol_range * - sinf(this->param_.patrol_omega * - static_cast(bsp_time_get_ms() - - autopatrol_start_time_) / - 1000.0f); - - yaw_out = this->yaw_actuator_.Calculate(autopatrol_yaw, this->gyro_.z, - this->eulr_.yaw, this->dt_); - pit_out = this->pit_actuator_.Calculate( - this->param_.patrol_hight, this->gyro_.x, this->eulr_.pit, this->dt_); - - this->yaw_motor_.Control(yaw_out); - this->pit_motor_.Control(pit_out); - break; } } @@ -204,11 +168,6 @@ void Gimbal::SetMode(Mode mode) { this->setpoint_.eulr_.yaw = this->eulr_.yaw; } } - - if (mode == AUTOPATROL) { - autopatrol_start_time_ = bsp_time_get_ms(); - } - this->mode_ = mode; } diff --git a/src/module/gimbal/mod_gimbal.hpp b/src/module/gimbal/mod_gimbal.hpp index 953677f2..378c063d 100644 --- a/src/module/gimbal/mod_gimbal.hpp +++ b/src/module/gimbal/mod_gimbal.hpp @@ -20,8 +20,7 @@ class Gimbal { /* 云台运行模式 */ typedef enum { RELAX, /* 放松模式,电机不输出。一般情况云台初始化之后的模式 */ - ABSOLUTE, /* 绝对坐标系控制,控制在空间内的绝对姿态 */ - AUTOPATROL, /* 自动巡逻模式,云台yaw轴按sin曲线进行扫描 */ + ABSOLUTE, /* 绝对坐标系控制,控制在空间内的绝对姿态 */ } Mode; enum { @@ -37,7 +36,6 @@ class Gimbal { SET_MODE_ABSOLUTE, START_AUTO_AIM, STOP_AUTO_AIM, - SET_AUTOPATROL, } GimbalEvent; typedef struct { @@ -52,10 +50,6 @@ class Gimbal { Component::Type::Eulr mech_zero; - float patrol_range; - float patrol_omega; - float patrol_hight; - struct { Component::Type::CycleValue pitch_max; Component::Type::CycleValue pitch_min; @@ -86,8 +80,6 @@ class Gimbal { float dt_ = 0.0f; - uint32_t autopatrol_start_time_ = 0; - Param param_; Gimbal::Mode mode_ = RELAX; /* 云台模式 */ diff --git a/src/module/launcher/mod_launcher.cpp b/src/module/launcher/mod_launcher.cpp index 961485ce..838cb9ab 100644 --- a/src/module/launcher/mod_launcher.cpp +++ b/src/module/launcher/mod_launcher.cpp @@ -31,9 +31,13 @@ Launcher::Launcher(Param& param, float control_freq) launcher->ctrl_lock_.Wait(UINT32_MAX); switch (event) { /* 根据event设置模式 */ case CHANGE_FIRE_MODE_RELAX: + launcher->SetFireMode(static_cast(RELAX)); + break; case CHANGE_FIRE_MODE_SAFE: + launcher->SetFireMode(static_cast(SAFE)); + break; case CHANGE_FIRE_MODE_LOADED: - launcher->SetFireMode(static_cast(event)); + launcher->SetFireMode(static_cast(LOADED)); break; case LAUNCHER_START_FIRE: /* 摩擦轮开启条件下,开火控制fire为ture */ if (launcher->fire_ctrl_.fire_mode_ == LOADED) { @@ -51,12 +55,17 @@ Launcher::Launcher(Param& param, float control_freq) launcher->SetTrigMode(static_cast( (launcher->fire_ctrl_.trig_mode_ + 1) % CONTINUED)); break; + case LAUNCHER_STOP_TRIG: + launcher->SetTrigMode(static_cast(STOP)); + break; + case OPEN_COVER: launcher->cover_mode_ = OPEN; break; case CLOSE_COVER: launcher->cover_mode_ = CLOSE; break; + default: break; } @@ -133,6 +142,9 @@ void Launcher::Control() { case BURST: /* 爆发开火模式 */ max_burst = 5; break; + case STOP: + max_burst = 0; + break; default: max_burst = 1; break; @@ -141,6 +153,7 @@ void Launcher::Control() { switch (this->fire_ctrl_.trig_mode_) { case SINGLE: /* 点射开火模式 */ case BURST: /* 爆发开火模式 */ + case STOP: /* 计算是否是第一次按下开火键 */ this->fire_ctrl_.first_pressed_fire = @@ -168,10 +181,13 @@ void Launcher::Control() { case CONTINUED: { /* 持续开火模式 */ float launch_freq = this->LimitLauncherFreq(); this->fire_ctrl_.launch_delay = - (launch_freq == 0.0f) ? UINT32_MAX - : static_cast(1000.f / launch_freq); + (launch_freq == 0.0f) + ? UINT32_MAX + : static_cast(1000.f / launch_freq); /* 毫秒级延时 */ + break; } + default: break; } @@ -198,6 +214,7 @@ void Launcher::Control() { if ((fire_ctrl_.last_trig_angle - trig_angle_) / M_2PI * this->param_.num_trig_tooth > 0.9) { + /* 判定为未卡弹 */ if (!fire_ctrl_.stall) { fire_ctrl_.last_trig_angle = this->setpoint_.trig_angle_; /* 将拨弹电机角度进行循环加法,每次加(减)射出一颗弹丸的弧度变化 */ @@ -306,8 +323,7 @@ void Launcher::HeatLimit() { this->ref_.robot_status.shooter_cooling_value; this->heat_ctrl_.heat_increase = GAME_HEAT_INCREASE_17MM; } - /* 检测热量更新后,计算可发射弹丸 */ - + /* 检测热量更新后,计算可发射弹丸(裁判系统数据更新有延迟) */ if ((this->heat_ctrl_.heat != this->heat_ctrl_.last_heat) || this->heat_ctrl_.available_shot == 0 || (this->heat_ctrl_.heat == 0)) { this->heat_ctrl_.available_shot = static_cast( @@ -335,8 +351,8 @@ void Launcher::PraseRef() { float Launcher::LimitLauncherFreq() { /* 热量限制计算 */ float heat_percent = this->heat_ctrl_.heat / this->heat_ctrl_.heat_limit; - float stable_freq = - this->heat_ctrl_.cooling_rate / this->heat_ctrl_.heat_increase; + float stable_freq = this->heat_ctrl_.cooling_rate / + this->heat_ctrl_.heat_increase; /* 每秒可发弹量 */ if (this->param_.model == LAUNCHER_MODEL_42MM) { return stable_freq; } else { diff --git a/src/module/launcher/mod_launcher.hpp b/src/module/launcher/mod_launcher.hpp index b7e0c773..05808e9a 100644 --- a/src/module/launcher/mod_launcher.hpp +++ b/src/module/launcher/mod_launcher.hpp @@ -24,6 +24,7 @@ class Launcher { SINGLE, /* 单发开火模式 */ BURST, /* N爆发开火模式 */ CONTINUED, /* 持续开火模式 */ + STOP, } TrigMode; typedef enum { OPEN, CLOSE } CoverMode; @@ -32,12 +33,15 @@ class Launcher { CHANGE_FIRE_MODE_RELAX, CHANGE_FIRE_MODE_SAFE, CHANGE_FIRE_MODE_LOADED, + LAUNCHER_START_FIRE, /* 开火,拨弹盘开始发弹 */ + CHANGE_TRIG_MODE_SINGLE, CHANGE_TRIG_MODE_BURST, CHANGE_TRIG_MODE, + LAUNCHER_STOP_TRIG, + OPEN_COVER, CLOSE_COVER, - LAUNCHER_START_FIRE, /* 开火,拨弹盘开始发弹 */ } LauncherEvent; enum { diff --git a/src/robot/sentry/robot.cpp b/src/robot/sentry/robot.cpp index fa5183f5..ac36e47a 100644 --- a/src/robot/sentry/robot.cpp +++ b/src/robot/sentry/robot.cpp @@ -12,7 +12,7 @@ Robot::Sentry::Param param = { .type = Component::Mixer::OMNICROSS, .follow_pid_param = { - .k = 0.8f, + .k = 0.5f, .p = 1.0f, .i = 0.0f, .d = 0.0f, @@ -29,30 +29,18 @@ Robot::Sentry::Param param = { }, Component::CMD::EventMapItem{ Device::DR16::DR16_SW_L_POS_TOP, - Module::RMChassis::SET_MODE_RELAX, + Module::RMChassis::SET_MODE_INDENPENDENT }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_L_POS_MID,/* 模拟找到目标模式,云台绝对 */ - Module::RMChassis::SET_MODE_FOLLOW, + Device::DR16::DR16_SW_L_POS_MID, + Module::RMChassis::SET_MODE_FOLLOW }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_L_POS_BOT,/* 模拟未找到目标,巡逻模式 */ - Module::RMChassis::SET_MODE_ROTOR, - }, - Component::CMD::EventMapItem{ - Device::AI::AI_OFFLINE, - Module::RMChassis::SET_MODE_ROTOR - }, - Component::CMD::EventMapItem{ - Device::AI::AI_FIND_TARGET, + Device::DR16::DR16_SW_L_POS_BOT, Module::RMChassis::SET_MODE_ROTOR }, - Component::CMD::EventMapItem{ - Device::AI::AI_AUTOPATROL, - Module::RMChassis::SET_MODE_ROTOR - }, - Component::CMD::EventMapItem{ - Device::AI::AI_TURN, + Component::CMD::EventMapItem{ + Device::AI::AIControlData::AI_ROTOR, Module::RMChassis::SET_MODE_ROTOR } }, @@ -60,7 +48,7 @@ Robot::Sentry::Param param = { .actuator_param = { Component::SpeedActuator::Param{ .speed = { - .k = 0.00020f, + .k = 0.00015f, .p = 1.0f, .i = 0.0f, .d = 0.0f, @@ -93,7 +81,7 @@ Robot::Sentry::Param param = { }, Component::SpeedActuator::Param{ .speed = { - .k = 0.00020f, + .k = 0.00015f, .p = 1.0f, .i = 0.0f, .d = 0.0f, @@ -109,7 +97,7 @@ Robot::Sentry::Param param = { }, Component::SpeedActuator::Param{ .speed = { - .k = 0.00022f, + .k = 0.00015f, .p = 1.0f, .i = 0.0f, .d = 0.0f, @@ -175,11 +163,11 @@ Robot::Sentry::Param param = { .yaw_actr = { .speed = { /* GIMBAL_CTRL_YAW_OMEGA_IDX */ - .k = 1.2f, - .p = 1.0f, - .i = 0.1f, + .k = 0.28f, + .p = 1.f, + .i = 1.f, .d = 0.f, - .i_limit = 0.6f, + .i_limit = 0.2f, .out_limit = 1.0f, .d_cutoff_freq = -1.0f, .cycle = false, @@ -187,12 +175,12 @@ Robot::Sentry::Param param = { .position = { /* GIMBAL_CTRL_YAW_ANGLE_IDX */ - .k = 8.0f, + .k = 25.0f, .p = 1.0f, .i = 0.0f, .d = 0.0f, .i_limit = 0.0f, - .out_limit = 20.0f, + .out_limit = 10.0f, .d_cutoff_freq = -1.0f, .cycle = true, }, @@ -201,12 +189,12 @@ Robot::Sentry::Param param = { .out_cutoff_freq = -1.0f, }, - .pit_actr = { + .pit_actr = { .speed = { /* GIMBAL_CTRL_PIT_OMEGA_IDX */ - .k = 0.3f, + .k = 0.1f, .p = 1.0f, - .i = 0.5f, + .i = 0.0f, .d = 0.f, .i_limit = 0.8f, .out_limit = 1.0f, @@ -216,7 +204,7 @@ Robot::Sentry::Param param = { .position = { /* GIMBAL_CTRL_PIT_ANGLE_IDX */ - .k = 10.0f, + .k = 25.0f, .p = 1.0f, .i = 0.0f, .d = 0.0f, @@ -230,7 +218,6 @@ Robot::Sentry::Param param = { .out_cutoff_freq = -1.0f, }, - .yaw_motor = { .id_feedback = 0x206, .id_control = GM6020_CTRL_ID_BASE, @@ -246,18 +233,14 @@ Robot::Sentry::Param param = { }, .mech_zero = { - .yaw = 5.55f, - .pit = 0.50f, + .yaw = 1.58f, + .pit = 4.6f, .rol = 0.0f, }, - .patrol_range = 0.4f, - .patrol_omega = 2.0f, - .patrol_hight = 6.0, - .limit = { - .pitch_max = 0.60f, - .pitch_min = 0.19f, + .pitch_max = 4.9f, + .pitch_min = 4.46f, }, .EVENT_MAP = { @@ -270,24 +253,12 @@ Robot::Sentry::Param param = { Module::Gimbal::SET_MODE_ABSOLUTE }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_L_POS_MID,/* 模拟找到目标模式,云台绝对 */ + Device::DR16::DR16_SW_R_POS_MID, Module::Gimbal::SET_MODE_ABSOLUTE }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_L_POS_BOT,/* 模拟未找到目标,巡逻模式 */ - Module::Gimbal::SET_AUTOPATROL - }, - Component::CMD::EventMapItem{ - Device::AI::AI_OFFLINE, - Module::Gimbal::SET_AUTOPATROL - }, - Component::CMD::EventMapItem{ - Device::AI::AI_FIND_TARGET, + Device::DR16::DR16_SW_R_POS_BOT, Module::Gimbal::SET_MODE_ABSOLUTE - }, - Component::CMD::EventMapItem{ - Device::AI::AI_AUTOPATROL, - Module::Gimbal::SET_AUTOPATROL } }, @@ -308,7 +279,7 @@ Robot::Sentry::Param param = { .speed = { .k = 3.0f, .p = 1.0f, - .i = 0.5f, + .i = 0.0f, .d = 0.0f, .i_limit = 0.5f, .out_limit = 1.0f, @@ -370,10 +341,11 @@ Robot::Sentry::Param param = { .trig_motor = { Device::RMMotor::Param{ - .id_feedback = 0x206, + .id_feedback = 0x207, .id_control = M3508_M2006_CTRL_ID_EXTAND, .model = Device::RMMotor::MOTOR_M2006, .can = BSP_CAN_2, + .reverse = true, } }, @@ -393,7 +365,7 @@ Robot::Sentry::Param param = { }, .EVENT_MAP = { - Component::CMD::EventMapItem{ + Component::CMD::EventMapItem{ Component::CMD::CMD_EVENT_LOST_CTRL, Module::Launcher::CHANGE_FIRE_MODE_RELAX }, @@ -402,28 +374,24 @@ Robot::Sentry::Param param = { Module::Launcher::CHANGE_FIRE_MODE_SAFE }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_MID,/* 模拟找到目标模式,云台绝对 */ + Device::DR16::DR16_SW_R_POS_MID, Module::Launcher::CHANGE_FIRE_MODE_LOADED }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_BOT,/* 模拟未找到目标,巡逻模式 */ + Device::DR16::DR16_SW_R_POS_BOT, Module::Launcher::CHANGE_FIRE_MODE_LOADED }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_BOT,/* 模拟未找到目标,巡逻模式 */ + Device::DR16::DR16_SW_R_POS_BOT, Module::Launcher::LAUNCHER_START_FIRE }, Component::CMD::EventMapItem{ - Device::AI::AIControlData::AI_AUTOPATROL, - Module::Launcher::CHANGE_FIRE_MODE_RELAX - }, - Component::CMD::EventMapItem{ Device::AI::AIControlData::AI_FIRE_COMMAND, - Module::Launcher::LAUNCHER_START_FIRE + Module::Launcher::CHANGE_TRIG_MODE_BURST }, Component::CMD::EventMapItem{ - Device::AI::AIControlData::AI_FIRE_COMMAND, - Module::Launcher::CHANGE_TRIG_MODE_SINGLE + Device::AI::AIControlData::AI_STOP_FIRE, + Module::Launcher::LAUNCHER_STOP_TRIG } }, @@ -443,7 +411,7 @@ Robot::Sentry::Param param = { .speed = { .k = 3.0f, .p = 1.0f, - .i = 0.5f, + .i = 0.0f, .d = 0.0f, .i_limit = 0.5f, .out_limit = 1.0f, @@ -505,7 +473,7 @@ Robot::Sentry::Param param = { .trig_motor = { Device::RMMotor::Param{ - .id_feedback =0x207, + .id_feedback =0x206, .id_control = M3508_M2006_CTRL_ID_EXTAND, .model = Device::RMMotor::MOTOR_M2006, .can = BSP_CAN_2, @@ -519,19 +487,19 @@ Robot::Sentry::Param param = { .id_control = M3508_M2006_CTRL_ID_BASE, .model = Device::RMMotor::MOTOR_M3508, .can = BSP_CAN_2, - .reverse = true, + .reverse = false, }, Device::RMMotor::Param{ .id_feedback = 0x201, .id_control = M3508_M2006_CTRL_ID_BASE, .model = Device::RMMotor::MOTOR_M3508, .can = BSP_CAN_2, - .reverse = true, + .reverse = false, }, }, - .EVENT_MAP = { - Component::CMD::EventMapItem{ + .EVENT_MAP = { + Component::CMD::EventMapItem{ Component::CMD::CMD_EVENT_LOST_CTRL, Module::Launcher::CHANGE_FIRE_MODE_RELAX }, @@ -540,28 +508,24 @@ Robot::Sentry::Param param = { Module::Launcher::CHANGE_FIRE_MODE_SAFE }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_MID,/* 模拟找到目标模式,云台绝对 */ + Device::DR16::DR16_SW_R_POS_MID, Module::Launcher::CHANGE_FIRE_MODE_LOADED }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_BOT,/* 模拟未找到目标,巡逻模式 */ + Device::DR16::DR16_SW_R_POS_BOT, Module::Launcher::CHANGE_FIRE_MODE_LOADED }, Component::CMD::EventMapItem{ - Device::DR16::DR16_SW_R_POS_BOT,/* 模拟未找到目标,巡逻模式 */ + Device::DR16::DR16_SW_R_POS_BOT, Module::Launcher::LAUNCHER_START_FIRE }, Component::CMD::EventMapItem{ - Device::AI::AIControlData::AI_AUTOPATROL, - Module::Launcher::CHANGE_FIRE_MODE_RELAX - }, - Component::CMD::EventMapItem{ Device::AI::AIControlData::AI_FIRE_COMMAND, - Module::Launcher::LAUNCHER_START_FIRE + Module::Launcher::CHANGE_TRIG_MODE_BURST }, Component::CMD::EventMapItem{ - Device::AI::AIControlData::AI_FIRE_COMMAND, - Module::Launcher::CHANGE_TRIG_MODE_SINGLE + Device::AI::AIControlData::AI_STOP_FIRE, + Module::Launcher::LAUNCHER_STOP_TRIG } }, diff --git a/src/robot/sentry/robot.hpp b/src/robot/sentry/robot.hpp index 0694c301..95e1b8cb 100644 --- a/src/robot/sentry/robot.hpp +++ b/src/robot/sentry/robot.hpp @@ -27,6 +27,7 @@ class Sentry { Component::CMD cmd_; Device::AI ai_; + Device::AHRS ahrs_; Device::BMI088 bmi088_; Device::Can can_; @@ -40,7 +41,8 @@ class Sentry { Module::Launcher launcher1_; Module::Launcher launcher2_; Sentry(Param& param, float control_freq) - : cmd_(Component::CMD::CMD_OP_CTRL), + : cmd_(Component::CMD::CMD_AUTO_CTRL), + ai_(false), bmi088_(param.bmi088_rot), cap_(param.cap), chassis_(param.chassis, control_freq),