From 1a60cc4f3ce28e1c1cb18a306ab5b189d782da41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=BB=D0=B0=20=D0=93=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D1=83=D1=88=D0=BA=D0=BE?= Date: Fri, 24 Nov 2023 16:22:22 +0300 Subject: [PATCH] fixed bug --- main/cmd_can.c | 10 ++++------ main/console.c | 2 +- main/main.c | 4 ++-- sdkconfig | 31 ++++++++++++++++++------------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/main/cmd_can.c b/main/cmd_can.c index 048f642..6b7cf25 100644 --- a/main/cmd_can.c +++ b/main/cmd_can.c @@ -8,6 +8,7 @@ #include "xvprintf.h" #include "can.h" + static void register_send_can_frame(void); void register_can_commands(void) { @@ -21,18 +22,15 @@ static struct { } cansend_args; static int send_can_frame(int argc, char **argv) { - const char *delim = "#"; - int tmp_can_id = 0; - int tmp_id = 0; - char printf_str[30]; - char can_msg_str_buf[40]; + char printf_str[50]; + char can_msg_str_buf[50]; int nerrors = arg_parse(argc, argv, (void **) &cansend_args); if (nerrors != 0) { arg_print_errors(stderr, cansend_args.end, argv[0]); return 1; } - const char* can_msg_ptr = cansend_args.message->sval[0]; + const char *can_msg_ptr = cansend_args.message->sval[0]; strlcpy(can_msg_str_buf, can_msg_ptr, sizeof(can_msg_str_buf)); printf("%s\n", can_msg_str_buf); diff --git a/main/console.c b/main/console.c index 88c5222..dfcd36f 100644 --- a/main/console.c +++ b/main/console.c @@ -95,7 +95,7 @@ void console_task_interactive(void* arg) { ls.buf = buf; ls.prompt = prompt; linenoiseEditStart(&ls); - xTaskCreate(console_task_tx, "console tsk tx", 4096, NULL, CONFIG_CONSOLE_TX_PRIORITY, NULL); + xTaskCreate(console_task_tx, "console tsk tx", 5000, NULL, CONFIG_CONSOLE_TX_PRIORITY, NULL); esp_log_set_vprintf(&vxprintf); while (true) { line = linenoiseEditFeed(&ls); diff --git a/main/main.c b/main/main.c index ce4c47d..36afdd0 100644 --- a/main/main.c +++ b/main/main.c @@ -10,8 +10,8 @@ void app_main(void) { can_init(); init_tx_ringbuf(); - xTaskCreate(can_task, "can task", 4096, NULL, CONFIG_CAN_TASK_PRIORITY, NULL); + xTaskCreate(can_task, "can task", 4800, NULL, CONFIG_CAN_TASK_PRIORITY, NULL); initialize_filesystem(); initialize_console(); - xTaskCreate(console_task_interactive, "console tsk int", 4096, NULL, CONFIG_CONSOLE_INT_PRIORITY, NULL); + xTaskCreate(console_task_interactive, "console tsk int", 8000, NULL, CONFIG_CONSOLE_INT_PRIORITY, NULL); } diff --git a/sdkconfig b/sdkconfig index e144422..02872c4 100644 --- a/sdkconfig +++ b/sdkconfig @@ -406,15 +406,15 @@ CONFIG_CONSOLE_INT_PRIORITY=1 # # Compiler options # -# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set -CONFIG_COMPILER_OPTIMIZATION_SIZE=y +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_ENABLE=y # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set -CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y -CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=0 +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set CONFIG_COMPILER_HIDE_PATHS_MACROS=y # CONFIG_COMPILER_CXX_EXCEPTIONS is not set @@ -1013,6 +1013,7 @@ CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y # # Port # +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y # CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set @@ -1039,7 +1040,9 @@ CONFIG_FREERTOS_DEBUG_OCDAWARE=y # CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y # CONFIG_HAL_ASSERTION_DISABLE is not set -CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=0 +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y # end of Hardware Abstraction Layer (HAL) and Low Level (LL) @@ -1209,6 +1212,7 @@ CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y # # Hooks @@ -1616,14 +1620,14 @@ CONFIG_LOG_BOOTLOADER_LEVEL=1 CONFIG_FLASHMODE_DIO=y # CONFIG_FLASHMODE_DOUT is not set CONFIG_MONITOR_BAUD=115200 -# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set -# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set -CONFIG_OPTIMIZATION_LEVEL_RELEASE=y -CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y -# CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED is not set +CONFIG_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y # CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set -CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y -CONFIG_OPTIMIZATION_ASSERTION_LEVEL=0 +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 # CONFIG_CXX_EXCEPTIONS is not set CONFIG_STACK_CHECK_NONE=y # CONFIG_STACK_CHECK_NORM is not set @@ -1734,6 +1738,7 @@ CONFIG_TIMER_TASK_PRIORITY=1 CONFIG_TIMER_TASK_STACK_DEPTH=2048 CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set # CONFIG_L2_TO_L3_COPY is not set CONFIG_ESP_GRATUITOUS_ARP=y CONFIG_GARP_TMR_INTERVAL=60