From d72d3af2a7e99af89780fcfa66071f99db11c766 Mon Sep 17 00:00:00 2001 From: Attila Body Date: Mon, 16 Jun 2025 19:45:13 +0200 Subject: [PATCH] Improve app --- .gitignore | 2 ++ .vscode/launch.json | 4 ++-- components/app/inc/app.h | 4 ++-- components/app/src/app.cpp | 14 +++++++------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index da88945..a3f619c 100755 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ compile_commands.json /Debug/ /Release/ /config_*/ +.project +.cproject \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index d647806..7b62571 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,7 +16,7 @@ "device": "STM32F446RETx", //MCU used "interface": "swd", "serialNumber": "", //Set ST-Link ID if you use multiple at the same time - "runToEntryPoint": "main", + // "runToEntryPoint": "main", "svdFile": "${config:STM32VSCodeExtension.cubeCLT.path}/STMicroelectronics_CMSIS_SVD/STM32F446.svd", "v1": false, //Change it depending on ST Link version "serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver", @@ -43,7 +43,7 @@ "device": "STM32F446RETx", //MCU used "interface": "swd", "serialNumber": "", //Set ST-Link ID if you use multiple at the same time - "runToEntryPoint": "main", + // "runToEntryPoint": "main", "svdFile": "${config:STM32VSCodeExtension.cubeCLT.path}/STMicroelectronics_CMSIS_SVD/STM32F446.svd", "v1": false, //Change it depending on ST Link version "serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver", diff --git a/components/app/inc/app.h b/components/app/inc/app.h index 7b517fb..37b146f 100644 --- a/components/app/inc/app.h +++ b/components/app/inc/app.h @@ -16,7 +16,7 @@ #include #include -class app : public f4ll::initialized_singleton, f4ll::console_handler::iconsole_input +class app : public f4ll::initialized_singleton, public f4ll::console_handler::iconsole_input { friend class f4ll::initialized_singleton; @@ -43,7 +43,7 @@ private: thread_safe_console_output m_safe_conout; - void queue_ts(); + void queue_timestamp(); }; extern "C" { diff --git a/components/app/src/app.cpp b/components/app/src/app.cpp index 5d4b338..747c88d 100644 --- a/components/app/src/app.cpp +++ b/components/app/src/app.cpp @@ -30,7 +30,7 @@ app::app(void const *param) : m_con( f4ll::console_handler::init( USART2, DMA1, LL_DMA_STREAM_5, LL_DMA_STREAM_6, m_rx_buf_mem, sizeof(m_rx_buf_mem), m_tx_buf_mem, sizeof(m_tx_buf_mem), - nullptr)), + this)), m_safe_conout(m_con) { @@ -42,12 +42,12 @@ void app::main() m_cli_task_handle = xTaskCreateStatic( cli_task_dispatch, "CLI_task", CLI_TASK_STACK_LEN, this, osPriorityAboveNormal, m_cli_task_stack, &m_cli_task_buffer); - queue_ts(); + queue_timestamp(); m_safe_conout.print("-------------------------------------------\n"); while (true) { - queue_ts(); + queue_timestamp(); m_safe_conout.print("Hello woooooooooooooooooooooooooooooooorld!\n"); - vTaskDelay(pdMS_TO_TICKS(500)); + vTaskDelay(pdMS_TO_TICKS(2000)); LL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); } } @@ -71,12 +71,12 @@ void app::cli_task() { while (1) { vTaskDelay(pdMS_TO_TICKS(10000)); - queue_ts(); - m_safe_conout.print(">>> TICK <<<\n"); + // queue_ts(); + // m_safe_conout.print(">>> TICK <<<\n"); } } -void app::queue_ts() +void app::queue_timestamp() { char ts_buf[12]; uitodec(ts_buf, xTaskGetTickCount());