Ready to develop.
This commit is contained in:
commit
156db4ba59
|
|
@ -0,0 +1,2 @@
|
|||
.vscode/ccls-cache
|
||||
build
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[submodule "lib/Pico_USB_Host"]
|
||||
path = lib/Pico_USB_Host
|
||||
url = https://gitea.skadubpc.net/ulysse/Pico_USB_Host_Lib.git
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"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 Access Point",
|
||||
"detail": "Build and flash access point",
|
||||
"type": "shell",
|
||||
"dependsOn": [
|
||||
"Configure"
|
||||
],
|
||||
"command": "make",
|
||||
"args": [
|
||||
"-C",
|
||||
"build",
|
||||
"-j$(nproc)",
|
||||
"Flash_Access_Point"
|
||||
],
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "always",
|
||||
"focus": true,
|
||||
"panel": "shared",
|
||||
"showReuseMessage": true,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Flash Station",
|
||||
"detail": "Build and flash station",
|
||||
"type": "shell",
|
||||
"dependsOn": [
|
||||
"Configure"
|
||||
],
|
||||
"command": "make",
|
||||
"args": [
|
||||
"-C",
|
||||
"build",
|
||||
"-j$(nproc)",
|
||||
"Flash_Station"
|
||||
],
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
# Explicitely define board
|
||||
set(PICO_BOARD pico)
|
||||
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(Pico_USB_Tests C CXX ASM)
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
pico_sdk_init()
|
||||
|
||||
# Executables and sources
|
||||
add_executable(Pico_Host
|
||||
src/main_host.c
|
||||
)
|
||||
|
||||
add_executable(Pico_Device
|
||||
src/main_device.c
|
||||
)
|
||||
|
||||
# Libs
|
||||
add_subdirectory(lib/Pico_USB_Host)
|
||||
|
||||
target_link_libraries(Pico_Host
|
||||
pico_stdlib
|
||||
Pico_USB_Host
|
||||
)
|
||||
|
||||
target_link_libraries(Pico_Device
|
||||
pico_stdlib
|
||||
)
|
||||
|
||||
# Stdio configuration
|
||||
pico_enable_stdio_usb(Pico_Host 1)
|
||||
pico_enable_stdio_uart(Pico_Host 1)
|
||||
|
||||
pico_enable_stdio_usb(Pico_Device 1)
|
||||
pico_enable_stdio_uart(Pico_Device 1)
|
||||
|
||||
# Output
|
||||
pico_add_extra_outputs(Pico_Host)
|
||||
pico_add_extra_outputs(Pico_Device)
|
||||
|
||||
# Flash target
|
||||
add_custom_target(Flash_host
|
||||
DEPENDS Pico_Host
|
||||
COMMAND picotool load -f ${PROJECT_BINARY_DIR}/Pico_Host.uf2
|
||||
)
|
||||
|
||||
add_custom_target(Flash_Device
|
||||
DEPENDS Pico_Device
|
||||
COMMAND picotool load -f ${PROJECT_BINARY_DIR}/Pico_Device.uf2
|
||||
)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# PicoW_UDP_Tests
|
||||
|
||||
Test of the library PicoW_UDP_Lib.
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit adffbe805b938541659b6fa4688a5665ddbc5b9e
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#include <pico/stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
stdio_init_all();
|
||||
|
||||
gpio_init(PICO_DEFAULT_LED_PIN);
|
||||
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
|
||||
|
||||
while(true)
|
||||
{
|
||||
static uint64_t last_time = 0;
|
||||
uint64_t time = time_us_64();
|
||||
if(time - last_time > 1000 * 1000)
|
||||
{
|
||||
last_time = time;
|
||||
|
||||
static bool led_state = true;
|
||||
led_state = !led_state;
|
||||
|
||||
gpio_put(PICO_DEFAULT_LED_PIN, led_state);
|
||||
}
|
||||
|
||||
tight_loop_contents();
|
||||
}
|
||||
|
||||
return PICO_OK;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#include <pico/stdlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
stdio_init_all();
|
||||
|
||||
gpio_init(PICO_DEFAULT_LED_PIN);
|
||||
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
gpio_put(PICO_DEFAULT_LED_PIN, false);
|
||||
sleep_ms(100);
|
||||
gpio_put(PICO_DEFAULT_LED_PIN, true);
|
||||
sleep_ms(100);
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
tight_loop_contents();
|
||||
}
|
||||
|
||||
return PICO_OK;
|
||||
}
|
||||
Loading…
Reference in New Issue