Skip to content

Add Bangle.js 2, JDI memory displays and ACeP epd #7497

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

Merged
merged 7 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 17 additions & 1 deletion .github/actions/deps/external/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:

# arm
- name: Get arm toolchain
if: inputs.platform == 'aarch' || inputs.platform == 'arm'
if: inputs.platform == 'aarch' || inputs.platform == 'arm' || inputs.platform == 'nrf'
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '10-2020-q4'
Expand Down Expand Up @@ -65,6 +65,22 @@ runs:
echo >> $GITHUB_PATH "$PATH"
shell: bash

# nrf
- name: Get nrfutil 7+
if: inputs.platform == 'nrf'
run: |
wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
chmod +x nrfutil
./nrfutil install nrf5sdk-tools
mkdir -p $HOME/.local/bin
mv nrfutil $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Print nrfutil version
if: inputs.platform == 'nrf'
run: nrfutil -V
shell: bash

# riscv
- name: Get riscv toolchain
if: inputs.platform == 'riscv'
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }}
boards-arm: ${{ steps.set-matrix.outputs.boards-arm }}
boards-esp: ${{ steps.set-matrix.outputs.boards-esp }}
boards-nrf: ${{ steps.set-matrix.outputs.boards-nrf }}
boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }}
boards-rpi: ${{ steps.set-matrix.outputs.boards-rpi }}
cp-version: ${{ steps.set-up-submodules.outputs.version }}
Expand Down Expand Up @@ -252,6 +253,16 @@ jobs:
boards: ${{ needs.scheduler.outputs.boards-esp }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}

nrf:
needs: [scheduler, mpy-cross, tests]
if: ${{ needs.scheduler.outputs.boards-nrf != '[]' }}
uses: ./.github/workflows/build-boards.yml
secrets: inherit
with:
platform: nrf
boards: ${{ needs.scheduler.outputs.boards-nrf }}
cp-version: ${{ needs.scheduler.outputs.cp-version }}

riscv:
needs: [scheduler, mpy-cross, tests]
if: ${{ needs.scheduler.outputs.boards-riscv != '[]' }}
Expand Down
6 changes: 2 additions & 4 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ msgstr ""
msgid "%q out of range"
msgstr ""

#: ports/atmel-samd/common-hal/microcontroller/Pin.c
msgid "%q pin invalid"
msgstr ""

#: py/objrange.c py/objslice.c shared-bindings/random/__init__.c
msgid "%q step cannot be zero"
msgstr ""
Expand Down Expand Up @@ -1210,9 +1206,11 @@ msgid "Internal watchdog timer expired."
msgstr ""

#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/displayio/EPaperDisplay.c
msgid "Invalid %q"
msgstr ""

#: ports/atmel-samd/common-hal/microcontroller/Pin.c
#: shared-bindings/microcontroller/Pin.c
msgid "Invalid %q pin"
msgstr ""
Expand Down
3 changes: 3 additions & 0 deletions ports/atmel-samd/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ void port_finish_background_task(void) {
}
#endif

void port_background_tick(void) {
}

void port_background_task(void) {
}
9 changes: 8 additions & 1 deletion ports/atmel-samd/boards/openbook_m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ uint8_t stop_sequence[] = {
0x02, 0x80, 0xf0 // Power off
};

uint8_t refresh_sequence[] = {
0x12, 0x00
};

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
Expand All @@ -74,6 +78,7 @@ void board_init(void) {
bus,
start_sequence,
sizeof(start_sequence),
0, // start up time
stop_sequence,
sizeof(stop_sequence),
300, // width
Expand All @@ -92,13 +97,15 @@ void board_init(void) {
NO_COMMAND, // write_color_ram_command (can add this for grayscale eventually)
false, // color_bits_inverted
0x000000, // highlight_color
0x12, // refresh_display_command
refresh_sequence, // refresh_display_sequence
sizeof(refresh_sequence),
40, // refresh_time
&pin_PA01, // busy_pin
false, // busy_state
5, // seconds_per_frame
false, // chip_select (don't always toggle chip select)
false, // grayscale
false, // acep
false); // two_byte_sequence_length
}

Expand Down
7 changes: 7 additions & 0 deletions ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,10 @@ CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf

# Override optimization to keep binary small
OPTIMIZATION_FLAGS = -Os

# We don't have room for the fonts for terminalio for certain languages,
# so turn off terminalio and force a clean build.
ifneq (,$(filter $(TRANSLATION),ja ko ru))
CIRCUITPY_TERMINALIO = 0
RELEASE_NEEDS_CLEAN_BUILD = 1
endif
2 changes: 1 addition & 1 deletion ports/atmel-samd/common-hal/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ mcu_pin_function_t *mcu_find_pin_function(mcu_pin_function_t *table, const mcu_p
return table;
}
}
mp_raise_ValueError_varg(translate("%q pin invalid"), name);
mp_raise_ValueError_varg(translate("Invalid %q pin"), name);
}
3 changes: 3 additions & 0 deletions ports/broadcom/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ void port_start_background_task(void) {
void port_finish_background_task(void) {
}

void port_background_tick(void) {
}

void port_background_task(void) {
}
2 changes: 2 additions & 0 deletions ports/cxd56/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "supervisor/filesystem.h"
#include "supervisor/shared/stack.h"

void port_background_tick(void) {
}
void port_background_task(void) {
}
void port_start_background_task(void) {
Expand Down
5 changes: 4 additions & 1 deletion ports/espressif/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@
#include "common-hal/pulseio/PulseIn.h"
#endif

void port_background_task(void) {
void port_background_tick(void) {
// Zero delay in case FreeRTOS wants to switch to something else.
vTaskDelay(0);
#if CIRCUITPY_PULSEIO
pulsein_background();
#endif
}

void port_background_task(void) {
}

void port_start_background_task(void) {
}

Expand Down
8 changes: 7 additions & 1 deletion ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ const uint8_t display_stop_sequence[] = {
0x02, 0x00 // Power off
};

const uint8_t refresh_sequence[] = {
0x12, 0x00
};

void board_init(void) {
// Debug UART
#ifdef DEBUG
Expand Down Expand Up @@ -137,6 +141,7 @@ void board_init(void) {
display,
bus,
display_start_sequence, sizeof(display_start_sequence),
0, // start up time
display_stop_sequence, sizeof(display_stop_sequence),
296, // width
128, // height
Expand All @@ -154,13 +159,14 @@ void board_init(void) {
0x13, // write_color_ram_command
false, // color_bits_inverted
0x000000, // highlight_color
0x12, // refresh_display_command
refresh_sequence, sizeof(refresh_sequence),
1.0, // refresh_time
&pin_GPIO5, // busy_pin
false, // busy_state
5.0, // seconds_per_frame
false, // always_toggle_chip_select
true, // grayscale
false, // acep
false); // two_byte_sequence_length
}

Expand Down
2 changes: 2 additions & 0 deletions ports/litex/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

void port_background_task(void) {
}
void port_background_tick(void) {
}
void port_start_background_task(void) {
}
void port_finish_background_task(void) {
Expand Down
4 changes: 4 additions & 0 deletions ports/mimxrt10xx/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@
#include "supervisor/port.h"

void port_background_task(void) {
}

void port_background_tick(void) {
#if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO
audio_dma_background();
#endif
}

void port_start_background_task(void) {
}
void port_finish_background_task(void) {
Expand Down
12 changes: 9 additions & 3 deletions ports/nrf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ endif
#####################
.phony: dfu-gen dfu-flash

NRFUTIL = adafruit-nrfutil
NRFUTIL = nrfutil
ADAFRUIT_NRFUTIL = adafruit-nrfutil

ifeq ($(MCU_SUB_VARIANT),nrf52840)
DFU_TOUCH = --touch 1200
Expand All @@ -293,14 +294,19 @@ __check_defined = \
## Flash with DFU serial
dfu-flash: $(BUILD)/dfu-package.zip
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
$(NRFUTIL) --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank $(DFU_TOUCH)
$(ADAFRUIT_NRFUTIL) --verbose dfu serial --package $^ -p $(SERIAL) -b 115200 --singlebank $(DFU_TOUCH)

## Create DFU package file
dfu-gen: $(BUILD)/dfu-package.zip

$(BUILD)/dfu-package.zip: $(BUILD)/firmware.hex
$(NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip
$(ADAFRUIT_NRFUTIL) dfu genpkg --sd-req 0xFFFE --dev-type 0x0052 --application $^ $(BUILD)/dfu-package.zip

# Espruino DFU
$(BUILD)/firmware.espruino.zip: $(BUILD)/firmware.hex
$(Q)$(NRFUTIL) pkg generate $(BUILD)/firmware.espruino.zip --application $^ --application-version 0xff --hw-version 52 --sd-req 0xa9,0xae,0xb6 --key-file espruino_dfu_private_key.pem

espruino-dfu-gen: $(BUILD)/firmware.espruino.zip

include $(TOP)/py/mkrules.mk

Expand Down
13 changes: 12 additions & 1 deletion ports/nrf/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* THE SOFTWARE.
*/

#include "background.h"

#include "py/runtime.h"
#include "supervisor/filesystem.h"
#include "supervisor/port.h"
Expand All @@ -44,14 +46,23 @@

void port_start_background_task(void) {
}

void port_finish_background_task(void) {
}

void port_background_task(void) {
void port_background_tick(void) {
#if CIRCUITPY_AUDIOPWMIO
audiopwmout_background();
#endif
#if CIRCUITPY_AUDIOBUSIO
i2s_background();
#endif
}

// Allow boards to override this.
MP_WEAK void board_background_task(void) {
}

void port_background_task(void) {
board_background_task();
}
2 changes: 2 additions & 0 deletions ports/nrf/background.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@
#ifndef MICROPY_INCLUDED_NRF_BACKGROUND_H
#define MICROPY_INCLUDED_NRF_BACKGROUND_H

void board_background_task(void);

#endif // MICROPY_INCLUDED_NRF_BACKGROUND_H
Loading