Working compilation and almost every headers detection.
This commit is contained in:
parent
fd84d816e6
commit
96490c28ce
8
.ccls
8
.ccls
|
|
@ -1,7 +1 @@
|
|||
arm-none-eabi-gcc
|
||||
# Headers
|
||||
-Isrc
|
||||
-Isrc/wifi/headers
|
||||
-Ibuild/generated/pico_base
|
||||
|
||||
# Flags
|
||||
gcc-arm-none-eabi
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"nixEnvSelector.suggestion": false,
|
||||
"nixEnvSelector.nixFile": "${workspaceFolder}/shell.nix",
|
||||
"nixEnvSelector.useFlakes": false
|
||||
}
|
||||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e305fc0b4843068acbb7880f1dd2dc7cd8fb2640
|
||||
Subproject commit be22ab1cf48bd53b05e7380ab248f4a2749f2870
|
||||
|
|
@ -0,0 +1 @@
|
|||
build/compile_commands.json
|
||||
24
shell.nix
24
shell.nix
|
|
@ -1,24 +0,0 @@
|
|||
with import <nixpkgs> {};
|
||||
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
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
// Necessary includes from the Pico SDK
|
||||
#include <pico/stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <pico/stdio.h>
|
||||
#include <pico/cyw43_arch.h>
|
||||
#include <lwip/udp.h>
|
||||
#include <time.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue