-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add other Raspberry Pi Pico boards support
- Loading branch information
Showing
27 changed files
with
84 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
# Contributors: | ||
# ZettaScale Zenoh Team, <[email protected]> | ||
# | ||
name: rpi_pico_w | ||
name: rpi_pico | ||
|
||
on: | ||
push: | ||
|
@@ -21,12 +21,13 @@ on: | |
|
||
jobs: | ||
build: | ||
name: Build on ${{ matrix.os }} | ||
name: Build on ${{ matrix.os }} for ${{ matrix.pico_board }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
pico_board: ["pico", "pico_w", "pico2", "pico2_w"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jwlawson/[email protected] | ||
|
@@ -48,13 +49,15 @@ jobs: | |
export FREERTOS_KERNEL_PATH=$HOME/work/FreeRTOS-Kernel/ | ||
mkdir -p $FREERTOS_KERNEL_PATH | ||
cd $FREERTOS_KERNEL_PATH | ||
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git --branch V11.1.0 . | ||
git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git . | ||
git submodule update --init | ||
- name: Build examples | ||
run: | | ||
export PICO_SDK_PATH=$HOME/work/pico-sdk | ||
export FREERTOS_KERNEL_PATH=$HOME/work/FreeRTOS-Kernel/ | ||
cd $HOME/work/zenoh-pico/zenoh-pico/examples/rpi_pico_w | ||
cmake -Bbuild -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password | ||
cd $HOME/work/zenoh-pico/zenoh-pico/examples/rpi_pico | ||
cmake -Bbuild -DWIFI_SSID=wifi_network_ssid -DWIFI_PASSWORD=wifi_network_password -DPICO_BOARD="$PICO_BOARD" | ||
cmake --build ./build | ||
env: | ||
PICO_BOARD: ${{ matrix.pico_board}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
examples/rpi_pico_w/include/config.h.in → examples/rpi_pico/include/config.h.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,15 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
#include <stdio.h> | ||
|
||
#include "FreeRTOS.h" | ||
#include "config.h" | ||
|
||
#if WIFI_SUPPORT_ENABLED | ||
#include "pico/cyw43_arch.h" | ||
#endif | ||
|
||
#include "pico/stdlib.h" | ||
#include "task.h" | ||
|
||
|
@@ -23,6 +29,7 @@ | |
|
||
int app_main(); | ||
|
||
#if WIFI_SUPPORT_ENABLED | ||
void print_ip_address() { | ||
struct netif *netif = &cyw43_state.netif[CYW43_ITF_STA]; | ||
if (netif_is_up(netif)) { | ||
|
@@ -33,12 +40,12 @@ void print_ip_address() { | |
printf("Network interface is down.\n"); | ||
} | ||
} | ||
#endif | ||
|
||
void main_task(void *params) { | ||
(void)params; | ||
|
||
vTaskDelay(pdMS_TO_TICKS(1000)); | ||
|
||
#if WIFI_SUPPORT_ENABLED | ||
if (cyw43_arch_init()) { | ||
printf("Failed to initialise\n"); | ||
return; | ||
|
@@ -58,10 +65,15 @@ void main_task(void *params) { | |
printf("Offline mode\n"); | ||
app_main(); | ||
} | ||
#else | ||
app_main(); | ||
#endif | ||
|
||
printf("Terminate.\n"); | ||
|
||
#if WIFI_SUPPORT_ENABLED | ||
cyw43_arch_deinit(); | ||
#endif | ||
|
||
vTaskDelete(NULL); | ||
} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,10 @@ | |
// ZettaScale Zenoh Team, <[email protected]> | ||
// | ||
|
||
#ifndef ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H | ||
#define ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H | ||
#ifndef ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H | ||
#define ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H | ||
|
||
#include <time.h> | ||
|
||
#include "FreeRTOS.h" | ||
#include "event_groups.h" | ||
|
@@ -76,4 +78,4 @@ typedef struct { | |
} | ||
#endif | ||
|
||
#endif // ZENOH_PICO_SYSTEM_RPI_PICO_W_TYPES_H | ||
#endif // ZENOH_PICO_SYSTEM_RPI_PICO_TYPES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.