diff --git a/C_PicoSDK/.gitignore b/C_PicoSDK/.gitignore index d0bc435..378eac2 100644 --- a/C_PicoSDK/.gitignore +++ b/C_PicoSDK/.gitignore @@ -1,2 +1 @@ build -.vscode/ccls-cache \ No newline at end of file diff --git a/C_PicoSDK/.vscode/c_cpp_properties.json b/C_PicoSDK/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..002f28a --- /dev/null +++ b/C_PicoSDK/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Linux", + "intelliSenseMode": "linux-gcc-arm", + "browse": { + "path": [ + "${workspaceFolder}" + ], + "limitSymbolsToIncludedHeaders": true + }, + "compileCommands": "build/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/C_PicoSDK/.vscode/tasks.json b/C_PicoSDK/.vscode/tasks.json index 2b45c2a..a4498ab 100644 --- a/C_PicoSDK/.vscode/tasks.json +++ b/C_PicoSDK/.vscode/tasks.json @@ -1,12 +1,62 @@ { "version": "2.0.0", "tasks": [ + { + "label": "Configure", + "detail": "configure project", + "type": "shell", + "command": "cmake", + "args": [ + "-H.", + "-Bbuild", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" + ], + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "showReuseMessage": true, + "clear": true + } + }, { "label": "Build", "detail": "Build project", + "dependsOn": [ + "Configure" + ], "type": "shell", - "command": "cmake -H. -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=YES && make -j$(nproc) -C build", + "command": "make", "args": [ + "-C", + "build", + "-j$(nproc)" + ], + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared", + "showReuseMessage": true, + "clear": true + } + }, + { + "label": "Flash", + "detail": "Build and flash", + "type": "shell", + "dependsOn": [ + "Configure" + ], + "command": "make", + "args": [ + "-C", + "build", + "-j$(nproc)", + "Flash" ], "group": "build", "presentation": { @@ -22,8 +72,10 @@ "label": "Clean", "detail": "Clean build directory and executable", "type": "shell", - "command": "rm -rf build", + "command": "rm", "args": [ + "-rf", + "build" ], "group": "build", "presentation": { @@ -34,24 +86,6 @@ "showReuseMessage": false, "clear": true } - }, - { - "label": "Flash", - "detail": "Flash executable", - "type": "shell", - "dependsOn": "Build", - "command": "cd build && make Flash", - "args": [ - ], - "group": "build", - "presentation": { - "echo": true, - "reveal": "always", - "focus": true, - "panel": "shared", - "showReuseMessage": true, - "clear": true - } } - ] + ] } \ No newline at end of file diff --git a/C_PicoSDK/CMakeLists.txt b/C_PicoSDK/CMakeLists.txt index e7183e3..f8f70c4 100644 --- a/C_PicoSDK/CMakeLists.txt +++ b/C_PicoSDK/CMakeLists.txt @@ -15,21 +15,22 @@ set(CMAKE_CXX_STANDARD 17) pico_sdk_init() -add_executable(PicoSDKProject +add_executable(PicoSDKExec) +target_sources(PicoSDKExec PUBLIC src/main.c ) -target_link_libraries(PicoSDKProject +target_link_libraries(PicoSDKExec pico_stdlib ) # Stdio configuration -pico_enable_stdio_usb(PicoSDKProject 1) -pico_enable_stdio_uart(PicoSDKProject 1) +pico_enable_stdio_usb(PicoSDKExec 1) +pico_enable_stdio_uart(PicoSDKExec 1) -pico_add_extra_outputs(PicoSDKProject) +pico_add_extra_outputs(PicoSDKExec) add_custom_target(Flash - DEPENDS PicoSDKProject - COMMAND picotool load -f ${PROJECT_BINARY_DIR}/PicoSDKProject.uf2 + DEPENDS PicoSDKExec + COMMAND picotool load -f ${PROJECT_BINARY_DIR}/PicoSDKExec.uf2 ) diff --git a/C_PicoSDK/compile_commands.json b/C_PicoSDK/compile_commands.json deleted file mode 120000 index 25eb4b2..0000000 --- a/C_PicoSDK/compile_commands.json +++ /dev/null @@ -1 +0,0 @@ -build/compile_commands.json \ No newline at end of file