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

CI: Track MicroPython Edge #906

Open
wants to merge 9 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
3 changes: 2 additions & 1 deletion .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
types: [created]

env:
MICROPYTHON_VERSION: v1.23.0
MICROPYTHON_VERSION: feature/psram-and-wifi
MICROPYTHON_FLAVOUR: pimoroni

jobs:
build:
Expand Down
8 changes: 3 additions & 5 deletions ci/micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ function log_warning {
}

function micropython_clone {
log_inform "Using MicroPython $MICROPYTHON_VERSION"
git clone https://github.com/micropython/micropython
log_inform "Using MicroPython $MICROPYTHON_FLAVOUR/$MICROPYTHON_VERSION"
git clone https://github.com/$MICROPYTHON_FLAVOUR/micropython -b $MICROPYTHON_VERSION --depth=1
cd micropython
git checkout $MICROPYTHON_VERSION
git cherry-pick -n 932f76c6ba64c5a3e68de3324556d9979f09303b
git submodule update --init lib/pico-sdk
git submodule update --init lib/cyw43-driver
git submodule update --init lib/lwip
Expand All @@ -31,7 +29,7 @@ function micropython_clone {
function micropython_build_mpy_cross {
cd micropython/mpy-cross
ccache --zero-stats || true
CROSS_COMPILE="ccache " make
CROSS_COMPILE="ccache " USER_C_MODULES= make
ccache --show-stats || true
cd ../../
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/st7789/st7789.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ namespace pimoroni {
cs(pins.cs), dc(pins.dc), wr_sck(pins.wr_sck), rd_sck(pins.rd_sck), d0(pins.d0), bl(pins.bl) {

parallel_pio = pio1;
pio_set_gpio_base(parallel_pio, d0 + 8 >= 32 ? 16 : 0);
parallel_sm = pio_claim_unused_sm(parallel_pio, true);
parallel_offset = pio_add_program(parallel_pio, &st7789_parallel_program);

//gpio_init(wr_sck);
//gpio_set_dir(wr_sck, GPIO_OUT);
//gpio_set_function(wr_sck, GPIO_FUNC_SIO);
Expand Down
3 changes: 2 additions & 1 deletion micropython/board/PICO_W_ENVIRO/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@

#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT

#define MICROPY_HW_PIN_RESERVED(i) ((i) == CYW43_PIN_WL_HOST_WAKE || (i) == CYW43_PIN_WL_REG_ON)
int mp_hal_is_pin_reserved(int n);
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
136 changes: 0 additions & 136 deletions micropython/board/PICO_W_ENVIRO/pico_sdk.patch

This file was deleted.

3 changes: 2 additions & 1 deletion micropython/board/PICO_W_INKY/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@

#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT

#define MICROPY_HW_PIN_RESERVED(i) ((i) == CYW43_PIN_WL_HOST_WAKE || (i) == CYW43_PIN_WL_REG_ON)
int mp_hal_is_pin_reserved(int n);
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
136 changes: 0 additions & 136 deletions micropython/board/PICO_W_INKY/pico_sdk.patch

This file was deleted.

3 changes: 2 additions & 1 deletion micropython/board/RPI_PICO_W/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@

#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT

#define MICROPY_HW_PIN_RESERVED(i) ((i) == CYW43_PIN_WL_HOST_WAKE || (i) == CYW43_PIN_WL_REG_ON)
int mp_hal_is_pin_reserved(int n);
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
2 changes: 2 additions & 0 deletions micropython/examples/plasma_stick/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import uasyncio
import urequests
import time
import gc
import plasma
from plasma import plasma_stick
# Random functions! randrange is for picking integers from a range, and uniform is for floats.
Expand Down Expand Up @@ -258,3 +259,4 @@ def snow():

move_to_target() # nudge our current colours closer to the target colours
display_current() # display current colours to strip
gc.collect()
1 change: 1 addition & 0 deletions micropython/modules/picographics/picographics.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static const mp_map_elem_t picographics_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_UNICORN_PACK), MP_ROM_INT(DISPLAY_UNICORN_PACK) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_SCROLL_PACK), MP_ROM_INT(DISPLAY_SCROLL_PACK) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_PICO_W_EXPLORER), MP_ROM_INT(DISPLAY_PICO_W_EXPLORER) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY_EXPLORER), MP_ROM_INT(DISPLAY_EXPLORER) },

{ MP_ROM_QSTR(MP_QSTR_PEN_1BIT), MP_ROM_INT(PEN_1BIT) },
{ MP_ROM_QSTR(MP_QSTR_PEN_P4), MP_ROM_INT(PEN_P4) },
Expand Down
14 changes: 13 additions & 1 deletion micropython/modules/picographics/picographics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ typedef struct _ModPicoGraphics_obj_t {

bool get_display_settings(PicoGraphicsDisplay display, int &width, int &height, int &rotate, int &pen_type, PicoGraphicsBusType &bus_type) {
switch(display) {
case DISPLAY_EXPLORER:
width = 320;
height = 240;
bus_type = BUS_PARALLEL;
if(rotate == -1) rotate = (int)Rotation::ROTATE_0;
if(pen_type == -1) pen_type = PEN_RGB565;
break;
case DISPLAY_PICO_DISPLAY:
width = 240;
height = 135;
Expand Down Expand Up @@ -335,6 +342,10 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size
} else if (display == DISPLAY_PICO_W_EXPLORER) {
spi_bus = {PIMORONI_SPI_DEFAULT_INSTANCE, 17, SPI_DEFAULT_SCK, SPI_DEFAULT_MOSI, PIN_UNUSED, SPI_DEFAULT_MISO, 9};
}
} else if (bus_type == BUS_PARALLEL) {
if (display == DISPLAY_EXPLORER) {
parallel_bus = {27, 28, 30, 31, 32, 26};
}
}
}

Expand All @@ -349,7 +360,8 @@ mp_obj_t ModPicoGraphics_make_new(const mp_obj_type_t *type, size_t n_args, size
// TODO grab BUSY and RESET from ARG_extra_pins
self->display = m_new_class(Inky73, width, height, (Rotation)rotate, spi_bus);

} else if (display == DISPLAY_TUFTY_2040) {
} else if (display == DISPLAY_TUFTY_2040
|| display == DISPLAY_EXPLORER) {
self->display = m_new_class(ST7789, width, height, (Rotation)rotate, parallel_bus);

} else if (display == DISPLAY_LCD_160X80) {
Expand Down
Loading
Loading