From c65a2355e265666cb209dfdae732338ff9230d2d Mon Sep 17 00:00:00 2001 From: okhsunrog Date: Thu, 22 Feb 2024 23:47:16 +0300 Subject: [PATCH] started fixing project --- CMakeLists.txt | 2 +- main/main.c | 27 ++++++++++++++++++--------- sdkconfig.defaults | 44 -------------------------------------------- 3 files changed, 19 insertions(+), 54 deletions(-) delete mode 100644 sdkconfig.defaults diff --git a/CMakeLists.txt b/CMakeLists.txt index 43bedeb..1fe58e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # The following lines of boilerplate have to be in your project's CMakeLists # in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.5) include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(can_wizard) diff --git a/main/main.c b/main/main.c index 73a97aa..14d6b54 100644 --- a/main/main.c +++ b/main/main.c @@ -1,16 +1,25 @@ #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "can.h" -#include "fs.h" -#include "console.h" -#include "xvprintf.h" +// #include "can.h" +// #include "fs.h" +// #include "console.h" +// #include "xvprintf.h" void app_main(void) { - init_tx_ringbuf(); - xTaskCreate(can_task, "can task", 4800, NULL, CONFIG_CAN_TASK_PRIORITY, NULL); - initialize_filesystem(); - initialize_console(); - xTaskCreate(console_task_interactive, "console tsk int", 8000, NULL, CONFIG_CONSOLE_INT_PRIORITY, NULL); + printf("Hello world!\n"); + + // init_tx_ringbuf(); + // xTaskCreate(can_task, "can task", 4800, NULL, CONFIG_CAN_TASK_PRIORITY, NULL); + // initialize_filesystem(); + // initialize_console(); + // xTaskCreate(console_task_interactive, "console tsk int", 8000, NULL, CONFIG_CONSOLE_INT_PRIORITY, NULL); + for (int i = 10; i >= 0; i--) { + printf("Restarting in %d seconds...\n", i); + vTaskDelay(1000 / portTICK_PERIOD_MS); + } + printf("Restarting now.\n"); + fflush(stdout); + esp_restart(); } diff --git a/sdkconfig.defaults b/sdkconfig.defaults deleted file mode 100644 index 2ad7844..0000000 --- a/sdkconfig.defaults +++ /dev/null @@ -1,44 +0,0 @@ -# Reduce bootloader log verbosity -CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y -CONFIG_BOOTLOADER_LOG_LEVEL=2 - -# Increase main task stack size -CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 - - -# Enable filesystem -CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" - -# Enable FreeRTOS stats formatting functions, needed for 'tasks' command -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y - -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y - -CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168 -CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y -CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 -CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 -CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y -CONFIG_ESP_CONSOLE_SECONDARY_NONE=y -CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y -CONFIG_ESP_CONSOLE_UART_NUM=0 -CONFIG_ESP_INT_WDT=y -CONFIG_ESP_INT_WDT_TIMEOUT_MS=2000 -CONFIG_ESP_TASK_WDT_EN=y -CONFIG_ESP_TASK_WDT_INIT=y -CONFIG_ESP_TASK_WDT_TIMEOUT_S=15 -CONFIG_ESP_DEBUG_OCDAWARE=y -CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y - -CONFIG_FREERTOS_UNICORE=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y - -CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536