Improve app
This commit is contained in:
parent
01807f47ab
commit
d72d3af2a7
4 changed files with 13 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,3 +15,5 @@ compile_commands.json
|
||||||
/Debug/
|
/Debug/
|
||||||
/Release/
|
/Release/
|
||||||
/config_*/
|
/config_*/
|
||||||
|
.project
|
||||||
|
.cproject
|
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
|
@ -16,7 +16,7 @@
|
||||||
"device": "STM32F446RETx", //MCU used
|
"device": "STM32F446RETx", //MCU used
|
||||||
"interface": "swd",
|
"interface": "swd",
|
||||||
"serialNumber": "", //Set ST-Link ID if you use multiple at the same time
|
"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",
|
"svdFile": "${config:STM32VSCodeExtension.cubeCLT.path}/STMicroelectronics_CMSIS_SVD/STM32F446.svd",
|
||||||
"v1": false, //Change it depending on ST Link version
|
"v1": false, //Change it depending on ST Link version
|
||||||
"serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver",
|
"serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver",
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
"device": "STM32F446RETx", //MCU used
|
"device": "STM32F446RETx", //MCU used
|
||||||
"interface": "swd",
|
"interface": "swd",
|
||||||
"serialNumber": "", //Set ST-Link ID if you use multiple at the same time
|
"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",
|
"svdFile": "${config:STM32VSCodeExtension.cubeCLT.path}/STMicroelectronics_CMSIS_SVD/STM32F446.svd",
|
||||||
"v1": false, //Change it depending on ST Link version
|
"v1": false, //Change it depending on ST Link version
|
||||||
"serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver",
|
"serverpath": "${config:STM32VSCodeExtension.cubeCLT.path}/STLink-gdb-server/bin/ST-LINK_gdbserver",
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <task.h>
|
#include <task.h>
|
||||||
#include <thread_safe_console_output.h>
|
#include <thread_safe_console_output.h>
|
||||||
|
|
||||||
class app : public f4ll::initialized_singleton<app>, f4ll::console_handler::iconsole_input
|
class app : public f4ll::initialized_singleton<app>, public f4ll::console_handler::iconsole_input
|
||||||
{
|
{
|
||||||
friend class f4ll::initialized_singleton<app>;
|
friend class f4ll::initialized_singleton<app>;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ private:
|
||||||
|
|
||||||
thread_safe_console_output m_safe_conout;
|
thread_safe_console_output m_safe_conout;
|
||||||
|
|
||||||
void queue_ts();
|
void queue_timestamp();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -30,7 +30,7 @@ app::app(void const *param)
|
||||||
: m_con(
|
: m_con(
|
||||||
f4ll::console_handler::init(
|
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),
|
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)
|
m_safe_conout(m_con)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -42,12 +42,12 @@ void app::main()
|
||||||
m_cli_task_handle = xTaskCreateStatic(
|
m_cli_task_handle = xTaskCreateStatic(
|
||||||
cli_task_dispatch, "CLI_task", CLI_TASK_STACK_LEN, this, osPriorityAboveNormal, m_cli_task_stack, &m_cli_task_buffer);
|
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");
|
m_safe_conout.print("-------------------------------------------\n");
|
||||||
while (true) {
|
while (true) {
|
||||||
queue_ts();
|
queue_timestamp();
|
||||||
m_safe_conout.print("Hello woooooooooooooooooooooooooooooooorld!\n");
|
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);
|
LL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,12 +71,12 @@ void app::cli_task()
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
vTaskDelay(pdMS_TO_TICKS(10000));
|
vTaskDelay(pdMS_TO_TICKS(10000));
|
||||||
queue_ts();
|
// queue_ts();
|
||||||
m_safe_conout.print(">>> TICK <<<\n");
|
// m_safe_conout.print(">>> TICK <<<\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void app::queue_ts()
|
void app::queue_timestamp()
|
||||||
{
|
{
|
||||||
char ts_buf[12];
|
char ts_buf[12];
|
||||||
uitodec(ts_buf, xTaskGetTickCount());
|
uitodec(ts_buf, xTaskGetTickCount());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue