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