aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-09-28 14:36:31 +0200
committerlonkaars <loek@pipeframe.xyz>2022-09-28 14:36:31 +0200
commit265232d0ec91b457d882d0d0322e9d2f4b2cffac (patch)
treebfcdd1754e3ef7cdbfd4d5fdc2530c693b0301aa
parentacd6ce94aec16860ee5c0b690707db4feb428f72 (diff)
qt debug and editor autocomplete config for vscode (tested linux)
-rw-r--r--.vscode/c_cpp_properties.json13
-rw-r--r--.vscode/launch.json25
-rw-r--r--.vscode/settings.json3
-rw-r--r--.vscode/tasks.json71
-rw-r--r--client/client.pro1
-rw-r--r--makefile3
-rw-r--r--readme.md4
7 files changed, 110 insertions, 10 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 0000000..ff639d8
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,13 @@
+{
+ "configurations": [
+ {
+ "name": "stm32f091",
+ "compileCommands": "${workspaceFolder}/stm32f091/compile_commands.json"
+ },
+ {
+ "name": "client",
+ "compileCommands": "${workspaceFolder}/client/compile_commands.json"
+ }
+ ],
+ "version": 4
+} \ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
index ddfe500..b038059 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -2,6 +2,30 @@
"version": "0.2.0",
"configurations": [
{
+ "name": "client debug",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "${workspaceFolder}/client/client",
+ "args": [],
+ "cwd": "${fileDirname}",
+ "environment": [],
+ "externalConsole": false,
+ "MIMode": "gdb",
+ "preLaunchTask": "client/build",
+ "setupCommands": [
+ {
+ "description": "Enable pretty-printing for gdb",
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ },
+ {
+ "description": "Set Disassembly Flavor to Intel",
+ "text": "-gdb-set disassembly-flavor intel",
+ "ignoreFailures": true
+ }
+ ]
+ },
+ {
"name": "stm32 debug",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/stm32f091/main.elf",
@@ -9,6 +33,7 @@
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "stlink",
+ "preLaunchTask": "stm32/build",
"windows": {
"armToolchainPath": "C:/msys64/mingw64/bin",
"stlinkPath": "C:/msys64/mingw64/bin/st-util.exe",
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 565c3cf..0dadf29 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -6,5 +6,6 @@
"args": [ "-defterm", "-no-start", "-mingw64", "-shell", "sh", "-here" ],
"icon": "terminal-bash"
}
- }
+ },
+ "cmake.configureOnOpen": false
}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 2bffcc7..8af62cd 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -11,44 +11,99 @@
},
"tasks": [
{
- "label": "build stm32 firmware",
+ "label": "stm32/build",
+ "detail": "build stm32 code without uploading",
"group": {
"isDefault": false,
"kind": "build"
},
"options": { "cwd": "${workspaceFolder}/stm32f091" },
+ "windows": {
+ "command": "make -j",
+ "args": [ "" ],
+ },
"command": "make",
- "args": [ "" ],
+ "args": [ "-j" ],
"type": "shell"
},
{
- "label": "flash stm32 firmware",
+ "label": "stm32/flash",
+ "detail": "build and upload to stm32",
"group": {
"isDefault": false,
"kind": "test"
},
"options": { "cwd": "${workspaceFolder}/stm32f091" },
"windows": {
- "command": "make flash",
+ "command": "make -j flash",
"args": [ "" ],
},
"command": "make",
- "args": [ "flash" ],
+ "args": [ "-j", "flash" ],
"type": "shell"
},
{
- "label": "generate compilation db",
+ "label": "stm32/compiledb",
+ "detail": "generate editor autocomplete files for stm23 source code",
"group": {
"isDefault": false,
"kind": "test"
},
"options": { "cwd": "${workspaceFolder}/stm32f091" },
"windows": {
- "command": "make compile_commands",
+ "command": "make -j compile_commands",
+ "args": [ "" ],
+ },
+ "command": "make",
+ "args": [ "-j", "compile_commands" ],
+ "type": "shell"
+ },
+ {
+ "label": "client/build",
+ "detail": "build qt client application",
+ "group": {
+ "isDefault": false,
+ "kind": "build"
+ },
+ "options": { "cwd": "${workspaceFolder}" },
+ "windows": {
+ "command": "make -j client",
+ "args": [ "" ],
+ },
+ "command": "make",
+ "args": [ "-j", "client" ],
+ "type": "shell"
+ },
+ {
+ "label": "client/compiledb",
+ "detail": "generate editor autocomplete files for qt client source code",
+ "group": {
+ "isDefault": false,
+ "kind": "test"
+ },
+ "options": { "cwd": "${workspaceFolder}" },
+ "windows": {
+ "command": "make -j client_compile_commands",
+ "args": [ "" ],
+ },
+ "command": "make",
+ "args": [ "-j", "client_compile_commands" ],
+ "type": "shell"
+ },
+ {
+ "label": "clean",
+ "detail": "remove binary files from working directory",
+ "group": {
+ "isDefault": false,
+ "kind": "test"
+ },
+ "options": { "cwd": "${workspaceFolder}" },
+ "windows": {
+ "command": "make clean",
"args": [ "" ],
},
"command": "make",
- "args": [ "compile_commands" ],
+ "args": [ "clean" ],
"type": "shell"
}
]
diff --git a/client/client.pro b/client/client.pro
index a9f38f1..cd0990a 100644
--- a/client/client.pro
+++ b/client/client.pro
@@ -11,3 +11,4 @@ SOURCES += \
target.path = $$[QT_INSTALL_EXAMPLES]/charts/zoomlinechart
INSTALLS += target
+CONFIG += force_debug_info
diff --git a/makefile b/makefile
index 0f478fd..60e06ef 100644
--- a/makefile
+++ b/makefile
@@ -10,5 +10,8 @@ client_makefile:
client: client_makefile
make -C client
+client_compile_commands: client_makefile
+ compiledb -o client/compile_commands.json make -C client
+
stm32:
make -C stm32f091
diff --git a/readme.md b/readme.md
index 4d15c13..dbbd800 100644
--- a/readme.md
+++ b/readme.md
@@ -20,7 +20,9 @@ listed below. toolchain installation scripts can be found in the
|STM32 makefile compilation|yes|yes|?|
|STM32 makefile upload|yes|yes|?|
|STM32 debugging (vscode)|yes|yes|?|
+|STM32 editor autocomplete|yes|?|?|
|QT client compilation (qmake)|yes|?|?|
|QT client running|yes|?|?|
-|QT client debugging (vscode)|?|?|?|
+|QT client debugging (vscode)|yes|?|?|
+|QT client editor autocomplete|yes|?|?|