Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fixes for SDK 2.0.0 #1008

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
build:
name: ${{matrix.name}} (C++)
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion drivers/pcf85063a/pcf85063a.hpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions drivers/pwm/pwm_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/pwm/pwm_cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion micropython/modules/micropython-pico.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions micropython/modules/micropython-pico2w.cmake
Original file line number Diff line number Diff line change
@@ -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)
1 change: 0 additions & 1 deletion micropython/modules/micropython-pico_usb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion micropython/modules/micropython-picolipo_16mb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

include(micropython-common)
include(pico_wireless/micropython)

enable_ulab()

Expand Down
1 change: 0 additions & 1 deletion micropython/modules/micropython-picolipo_4mb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

include(micropython-common)
include(pico_wireless/micropython)

enable_ulab()

Expand Down
24 changes: 12 additions & 12 deletions micropython/modules/pico_wireless/pico_wireless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down