kopia lustrzana https://github.com/pimoroni/pimoroni-pico
commit
3b03a30963
|
@ -12,7 +12,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{matrix.name}} (C++)
|
name: ${{matrix.name}} (C++)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -56,11 +56,15 @@ jobs:
|
||||||
path: pico-extras
|
path: pico-extras
|
||||||
submodules: false # lwip breaks audio submodule fetching
|
submodules: false # lwip breaks audio submodule fetching
|
||||||
|
|
||||||
|
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
|
||||||
|
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||||
|
with:
|
||||||
|
release: '13.3.Rel1'
|
||||||
|
|
||||||
# Linux deps
|
# Linux deps
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
sudo apt update && sudo apt install ccache gcc-arm-none-eabi
|
sudo apt update && sudo apt install ccache
|
||||||
|
|
||||||
- name: Create Build Environment
|
- name: Create Build Environment
|
||||||
run: cmake -E make_directory ${{runner.workspace}}/build
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
||||||
|
|
|
@ -12,7 +12,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: ${{ matrix.name }} (${{ matrix.board }})
|
name: ${{ matrix.name }} (${{ matrix.board }})
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -71,7 +71,7 @@ jobs:
|
||||||
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
|
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
|
||||||
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
uses: carlosperate/arm-none-eabi-gcc-action@v1
|
||||||
with:
|
with:
|
||||||
release: '9-2020-q2'
|
release: '13.3.Rel1'
|
||||||
|
|
||||||
- name: Install CCache
|
- name: Install CCache
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "hardware/i2c.h"
|
#include "hardware/i2c.h"
|
||||||
#include "hardware/rtc.h"
|
#include "pico/types.h"
|
||||||
|
|
||||||
#include "common/pimoroni_common.hpp"
|
#include "common/pimoroni_common.hpp"
|
||||||
#include "common/pimoroni_i2c.hpp"
|
#include "common/pimoroni_i2c.hpp"
|
||||||
|
|
|
@ -25,10 +25,10 @@ uint8_t PWMCluster::claimed_sms[] = { 0x0, 0x0 };
|
||||||
uint PWMCluster::pio_program_offset = 0;
|
uint PWMCluster::pio_program_offset = 0;
|
||||||
|
|
||||||
|
|
||||||
PWMCluster::PWMCluster(PIO pio, uint sm, uint pin_mask, bool loading_zone)
|
PWMCluster::PWMCluster(PIO pio, uint sm, uint64_t pin_mask, bool loading_zone)
|
||||||
: pio(pio)
|
: pio(pio)
|
||||||
, sm(sm)
|
, sm(sm)
|
||||||
, pin_mask(pin_mask & ((1u << NUM_BANK0_GPIOS) - 1))
|
, pin_mask(pin_mask & ((1llu << NUM_BANK0_GPIOS) - 1))
|
||||||
, channel_count(0)
|
, channel_count(0)
|
||||||
, wrap_level(0)
|
, wrap_level(0)
|
||||||
, loading_zone(loading_zone) {
|
, loading_zone(loading_zone) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace pimoroni {
|
||||||
PIO pio;
|
PIO pio;
|
||||||
uint sm;
|
uint sm;
|
||||||
int dma_channel;
|
int dma_channel;
|
||||||
uint pin_mask;
|
uint64_t pin_mask;
|
||||||
uint8_t channel_count;
|
uint8_t channel_count;
|
||||||
ChannelState channels[NUM_BANK0_GPIOS];
|
ChannelState channels[NUM_BANK0_GPIOS];
|
||||||
uint8_t channel_to_pin_map[NUM_BANK0_GPIOS];
|
uint8_t channel_to_pin_map[NUM_BANK0_GPIOS];
|
||||||
|
@ -135,7 +135,7 @@ namespace pimoroni {
|
||||||
// Constructors/Destructor
|
// Constructors/Destructor
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public:
|
public:
|
||||||
PWMCluster(PIO pio, uint sm, uint pin_mask, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
PWMCluster(PIO pio, uint sm, uint64_t pin_mask, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
||||||
PWMCluster(PIO pio, uint sm, uint pin_base, uint pin_count, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
PWMCluster(PIO pio, uint sm, uint pin_base, uint pin_count, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
||||||
PWMCluster(PIO pio, uint sm, const uint8_t *pins, uint32_t length, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
PWMCluster(PIO pio, uint sm, const uint8_t *pins, uint32_t length, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
||||||
PWMCluster(PIO pio, uint sm, std::initializer_list<uint8_t> pins, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
PWMCluster(PIO pio, uint sm, std::initializer_list<uint8_t> pins, bool loading_zone = DEFAULT_USE_LOADING_ZONE);
|
||||||
|
|
|
@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
include(micropython-common)
|
include(micropython-common)
|
||||||
include(pico_wireless/micropython)
|
|
||||||
|
|
||||||
# C++ Magic Memory
|
# C++ Magic Memory
|
||||||
include(cppmem/micropython)
|
include(cppmem/micropython)
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/../../)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../")
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../")
|
||||||
|
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
|
include(micropython-common)
|
||||||
|
|
||||||
|
# C++ Magic Memory
|
||||||
|
include(cppmem/micropython)
|
||||||
|
|
||||||
|
# Disable build-busting C++ exceptions
|
||||||
|
include(micropython-disable-exceptions)
|
|
@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
include(micropython-common)
|
include(micropython-common)
|
||||||
include(pico_wireless/micropython)
|
|
||||||
|
|
||||||
# C++ Magic Memory
|
# C++ Magic Memory
|
||||||
include(cppmem/micropython)
|
include(cppmem/micropython)
|
||||||
|
|
|
@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
include(micropython-common)
|
include(micropython-common)
|
||||||
include(pico_wireless/micropython)
|
|
||||||
|
|
||||||
enable_ulab()
|
enable_ulab()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
include(micropython-common)
|
include(micropython-common)
|
||||||
include(pico_wireless/micropython)
|
|
||||||
|
|
||||||
enable_ulab()
|
enable_ulab()
|
||||||
|
|
||||||
|
|
|
@ -59,15 +59,15 @@ mp_obj_t picowireless_init() {
|
||||||
|
|
||||||
mp_obj_t picowireless_get_network_data() {
|
mp_obj_t picowireless_get_network_data() {
|
||||||
if(wireless != nullptr) {
|
if(wireless != nullptr) {
|
||||||
uint8_t *ip = nullptr;
|
IPAddress ip;
|
||||||
uint8_t *mask = nullptr;
|
IPAddress mask;
|
||||||
uint8_t *gwip = nullptr;
|
IPAddress gwip;
|
||||||
wireless->get_network_data(ip, mask, gwip);
|
wireless->get_network_data((uint8_t *)&ip, (uint8_t *)&mask, (uint8_t *)&gwip);
|
||||||
|
|
||||||
mp_obj_t tuple[3];
|
mp_obj_t tuple[3];
|
||||||
tuple[0] = mp_obj_new_bytes(ip, WL_IPV4_LENGTH);
|
tuple[0] = mp_obj_new_bytes((uint8_t *)&ip, WL_IPV4_LENGTH);
|
||||||
tuple[1] = mp_obj_new_bytes(mask, WL_IPV4_LENGTH);
|
tuple[1] = mp_obj_new_bytes((uint8_t *)&mask, WL_IPV4_LENGTH);
|
||||||
tuple[2] = mp_obj_new_bytes(gwip, WL_IPV4_LENGTH);
|
tuple[2] = mp_obj_new_bytes((uint8_t *)&gwip, WL_IPV4_LENGTH);
|
||||||
return mp_obj_new_tuple(3, tuple);
|
return mp_obj_new_tuple(3, tuple);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -86,13 +86,13 @@ mp_obj_t picowireless_get_remote_data(size_t n_args, const mp_obj_t *pos_args, m
|
||||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||||
|
|
||||||
uint8_t *ip = nullptr;
|
IPAddress ip;
|
||||||
uint8_t *port = nullptr;
|
uint16_t port = 0;
|
||||||
wireless->get_remote_data(args[ARG_sock].u_int, ip, port);
|
wireless->get_remote_data(args[ARG_sock].u_int, (uint8_t *)&ip, (uint8_t *)&port);
|
||||||
|
|
||||||
mp_obj_t tuple[2];
|
mp_obj_t tuple[2];
|
||||||
tuple[0] = mp_obj_new_bytes(ip, WL_IPV4_LENGTH);
|
tuple[0] = mp_obj_new_bytes((uint8_t *)&ip, WL_IPV4_LENGTH);
|
||||||
tuple[1] = mp_obj_new_int((uint16_t)port[0] << 8 | (uint16_t)port[1]); //TODO verify size and ordering of port
|
tuple[1] = mp_obj_new_int(port); //TODO verify size and ordering of port
|
||||||
return mp_obj_new_tuple(2, tuple);
|
return mp_obj_new_tuple(2, tuple);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Ładowanie…
Reference in New Issue