diff --git a/.ccls b/.ccls index 17a6ea6..69f244c 100644 --- a/.ccls +++ b/.ccls @@ -1,7 +1 @@ -arm-none-eabi-gcc -# Headers --Isrc --Isrc/wifi/headers --Ibuild/generated/pico_base - -# Flags +gcc-arm-none-eabi \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c6b1ff1..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "nixEnvSelector.suggestion": false, - "nixEnvSelector.nixFile": "${workspaceFolder}/shell.nix", - "nixEnvSelector.useFlakes": false -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e70a949..2b45c2a 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,12 +1,14 @@ { + "version": "2.0.0", "tasks": [ { - "label": "CMake & Make", + "label": "Build", + "detail": "Build project", "type": "shell", + "command": "cmake -H. -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=YES && make -j$(nproc) -C build", + "args": [ + ], "group": "build", - - "command": "mkdir -p build && cd build && cmake ../ && make", - "presentation": { "echo": true, "reveal": "always", @@ -17,12 +19,31 @@ } }, { - "label": "CMake & Make & Flash", + "label": "Clean", + "detail": "Clean build directory and executable", "type": "shell", + "command": "rm -rf build", + "args": [ + ], + "group": "build", + "presentation": { + "echo": false, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true + } + }, + { + "label": "Flash", + "detail": "Flash executable", + "type": "shell", + "dependsOn": "Build", + "command": "cd build && make Flash", + "args": [ + ], "group": "build", - - "command": "mkdir -p build && cd build && cmake ../ && make Flash", - "presentation": { "echo": true, "reveal": "always", @@ -32,6 +53,5 @@ "clear": true } } - ], - "version": "2.0.0" + ] } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ee282ae..3a4534b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,38 +1,40 @@ cmake_minimum_required(VERSION 3.13) -# Définir explicitement la carte comme Pico W +# Explicitely define board set(PICO_BOARD pico_w) if(NOT DEFINED PICO_BOARD) add_definitions(-DPICO_BOARD=${PICO_BOARD}) endif() -# Need to include pico-sdk cmake support. Must happen before project. +# Include pico-sdk cmake support include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake) project(PicoW_UDP_Tests C CXX ASM) -set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD 17) set(CMAKE_CXX_STANDARD 17) pico_sdk_init() -# libs -add_subdirectory(PicoW_UDP) - +# Sources add_executable(PicoW_UDP_Tests src/main.c ) +# Libs +add_subdirectory(PicoW_UDP) target_link_libraries(PicoW_UDP_Tests pico_stdlib PicoW_UDP ) -# Configuration du stdio +# Stdio configuration pico_enable_stdio_usb(PicoW_UDP_Tests 1) pico_enable_stdio_uart(PicoW_UDP_Tests 1) +# Output pico_add_extra_outputs(PicoW_UDP_Tests) +# Flash target add_custom_target(Flash DEPENDS PicoW_UDP_Tests COMMAND picotool load -f ${PROJECT_BINARY_DIR}/PicoW_UDP_Tests.uf2 diff --git a/PicoW_UDP b/PicoW_UDP index e305fc0..be22ab1 160000 --- a/PicoW_UDP +++ b/PicoW_UDP @@ -1 +1 @@ -Subproject commit e305fc0b4843068acbb7880f1dd2dc7cd8fb2640 +Subproject commit be22ab1cf48bd53b05e7380ab248f4a2749f2870 diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 0000000..25eb4b2 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +build/compile_commands.json \ No newline at end of file diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 8f259a3..0000000 --- a/shell.nix +++ /dev/null @@ -1,24 +0,0 @@ -with import {}; -let - # Needs to be synced past - # https://github.com/NixOS/nixpkgs/pull/321786 - local-pico-sdk = pkgs.pico-sdk.override { - withSubmodules = true; - }; -in -pkgs.mkShell { - buildInputs = with pkgs; [ - gcc-arm-embedded - local-pico-sdk - picotool - - cmake python3 # build requirements for pico-sdk - udisks # Interact with bootloader filesystem - tio # terminal program to interface with serial - ]; - shellHook = '' - export PICO_SDK_PATH=${local-pico-sdk}/lib/pico-sdk - export NIX_CFLAGS_COMPILE="-isystem $(shopt -s globstar && echo $PICO_SDK_PATH/lib/**/include | sed "s/ / -isystem /g") -isystem $(shopt -s globstar && echo $PICO_SDK_PATH/src/**/include | sed "s/ / -isystem /g") -isystem $(shopt -s globstar && echo $PICO_SDK_PATH/lib/**/src | sed "s/ / -isystem /g") $NIX_CFLAGS_COMPILE" - unset TEMP TMP TEMPDIR TMPDIR - ''; -} diff --git a/src/main.c b/src/main.c index dee34ed..4762036 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,5 @@ -// Necessary includes from the Pico SDK -#include #include +#include #include #include #include