Initial commit.

This commit is contained in:
Ulysse Cura 2026-09-21 19:08:44 +02:00
commit ef0b9a8602
10 changed files with 206 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode/ccls-cache
build

6
.gitmodules vendored Normal file
View File

@ -0,0 +1,6 @@
[submodule "lib/PicoW_UDP"]
path = lib/PicoW_UDP
url = https://gitea.skadubpc.net/ulysse/PicoW_UDP_Lib.git
[submodule "lib/PicoW_WiFi_Operator"]
path = lib/PicoW_WiFi_Operator
url = https://gitea.skadubpc.net/ulysse/PicoW_WiFi_Operator_Lib.git

26
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "linux-gcc-arm",
"includePath": [
"${env:PICO_SDK_PATH}/src/**/include/",
"${env:PICO_SDK_PATH}/lib/**/include/",
"${env:PICO_SDK_PATH}/lib/**/src/",
"${workspaceFolder}/build/generated/pico_base/",
"${workspaceFolder}/src/",
"${workspaceFolder}/lib/**/"
],
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
"cStandard": "c17",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}

90
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,90 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Configure",
"detail": "configure project",
"type": "shell",
"command": "cmake",
"args": [
"-H.",
"-Bbuild"
],
"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": "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 executable",
"type": "shell",
"dependsOn": [
"Configure"
],
"command": "make",
"args": [
"-C",
"build",
"-j$(nproc)",
"Flash"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "Clean",
"detail": "Clean build directory and executable",
"type": "shell",
"command": "rm",
"args": [
"-rf",
"build"
],
"group": "build",
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
}
}
]
}

43
CMakeLists.txt Normal file
View File

@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.13)
# Explicitely define board
set(PICO_BOARD pico_w)
if(NOT DEFINED PICO_BOARD)
add_definitions(-DPICO_BOARD=${PICO_BOARD})
endif()
# 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 17)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
# Sources
add_executable(PicoW_UDP_Tests
src/main.c
)
# Libs
add_subdirectory(lib/PicoW_WiFi_Operator)
add_subdirectory(lib/PicoW_UDP)
target_link_libraries(PicoW_UDP_Tests
pico_stdlib
PicoW_WiFi_Operator
PicoW_UDP
)
# 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
)

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# PicoW_UDP_Tests
Test of the library PicoW_UDP_Lib.

1
lib/PicoW_UDP Submodule

@ -0,0 +1 @@
Subproject commit 0000000000000000000000000000000000000000

@ -0,0 +1 @@
Subproject commit 0000000000000000000000000000000000000000

View File

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import socket
import time
import struct
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
pico_address = ('255.255.255.255', 4243)
packet_number = 0
instruction = 0
while True:
# Créer le message binaire
message = struct.pack('BB', packet_number, instruction)
sock.sendto(message, pico_address)
packet_number = (packet_number + 1) % 256
instruction = (instruction + 1) % 256
print("Sended")
time.sleep(3.5)

13
src/main.c Normal file
View File

@ -0,0 +1,13 @@
#include <pico/stdlib.h>
#include <stdio.h>
#include "PicoW_WiFi_Operator.h"
#include "PicoW_UDP.h"
int main(void)
{
stdio_init_all();
puts("Hello, World !");
return 0;
}