From da413094f8fa3fcc1043fe85796973a364d73e15 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 13:01:00 +0100 Subject: [PATCH 1/5] Added LDO control pin and initial setup --- ports/nrf/boards/challenger_840/board.c | 7 +++++++ ports/nrf/boards/challenger_840/pins.c | 1 + 2 files changed, 8 insertions(+) diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index fb1ce4fb83..677b6eac8b 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -25,5 +25,12 @@ */ #include "supervisor/board.h" +#include "nrf_gpio.h" + +#define PORTPIN(x, y) (x * 32 + y) // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. +void board_init(void) { + nrf_gpio_cfg_output(PORTPIN(1, 9)); + nrf_gpio_pin_write(PORTPIN(1, 9), 1); +} diff --git a/ports/nrf/boards/challenger_840/pins.c b/ports/nrf/boards/challenger_840/pins.c index 26d780fffe..e059c17a15 100644 --- a/ports/nrf/boards/challenger_840/pins.c +++ b/ports/nrf/boards/challenger_840/pins.c @@ -32,6 +32,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_LDO_CONTROL), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_11) }, From fa14307c7d7bc297d550191c199ac621cc7b08a7 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:19:43 +0530 Subject: [PATCH 2/5] update `tj-actions/changed-files` to `v34.5.3` --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c584f5f427..9bae2e9983 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: - name: Get changes id: get-changes if: github.event_name == 'pull_request' - uses: tj-actions/changed-files@v34 + uses: tj-actions/changed-files@v34.5.3 with: json: true sha: ${{ steps.get-last-commit-with-checks.outputs.commit && github.event.after }} From 628865b2357bd1c344757a55ffbed763dc506121 Mon Sep 17 00:00:00 2001 From: MicroDev <70126934+MicroDev1@users.noreply.github.com> Date: Sun, 11 Dec 2022 20:32:12 +0530 Subject: [PATCH 3/5] change fetch-depth setting in ci --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bae2e9983..856072b50a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: false - fetch-depth: 1 + fetch-depth: 0 - name: Set up Python 3 uses: actions/setup-python@v4 with: From f7e735b492c4bf270ba8312a4459ac2cea4b17a4 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 17:11:24 +0100 Subject: [PATCH 4/5] Added LDO control pin, new flash variants and support functions for the LDO control pin. --- ports/nrf/boards/challenger_840/board.c | 11 ----------- ports/nrf/boards/challenger_840/challenger_840.py | 14 ++++++++++++++ ports/nrf/boards/challenger_840/mpconfigboard.mk | 6 +++++- 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 ports/nrf/boards/challenger_840/challenger_840.py diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index 677b6eac8b..14a52fc4de 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -23,14 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#include "supervisor/board.h" -#include "nrf_gpio.h" - -#define PORTPIN(x, y) (x * 32 + y) - -// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. -void board_init(void) { - nrf_gpio_cfg_output(PORTPIN(1, 9)); - nrf_gpio_pin_write(PORTPIN(1, 9), 1); -} diff --git a/ports/nrf/boards/challenger_840/challenger_840.py b/ports/nrf/boards/challenger_840/challenger_840.py new file mode 100644 index 0000000000..b40ae22b41 --- /dev/null +++ b/ports/nrf/boards/challenger_840/challenger_840.py @@ -0,0 +1,14 @@ +import board +import digitalio + +_LDO_PIN = digitalio.DigitalInOut(board.LDO_CONTROL) +_LDO_PIN.direction = digitalio.Direction.OUTPUT +_LDO_PIN.value = True + +def ldo_on(): + global _LDO_PIN + _LDO_PIN.value = True + +def ldo_off(): + global _LDO_PIN + _LDO_PIN.value = False diff --git a/ports/nrf/boards/challenger_840/mpconfigboard.mk b/ports/nrf/boards/challenger_840/mpconfigboard.mk index ddb55ce705..03cbc20b21 100644 --- a/ports/nrf/boards/challenger_840/mpconfigboard.mk +++ b/ports/nrf/boards/challenger_840/mpconfigboard.mk @@ -6,4 +6,8 @@ USB_MANUFACTURER = "Invector Labs AB" MCU_CHIP = nrf52840 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q64FV" +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q32JVxQ,W25Q64FV,W25Q64JVxQ" + +FROZEN_MPY_DIRS += $(TOP)/ports/nrf/boards/challenger_840 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From 66eca9c35e9da27232c67b9504b0bec6b6828dd0 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 17:25:26 +0100 Subject: [PATCH 5/5] Updated formatting. --- ports/nrf/boards/challenger_840/challenger_840.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/boards/challenger_840/challenger_840.py b/ports/nrf/boards/challenger_840/challenger_840.py index b40ae22b41..bf3ae77170 100644 --- a/ports/nrf/boards/challenger_840/challenger_840.py +++ b/ports/nrf/boards/challenger_840/challenger_840.py @@ -5,10 +5,12 @@ _LDO_PIN = digitalio.DigitalInOut(board.LDO_CONTROL) _LDO_PIN.direction = digitalio.Direction.OUTPUT _LDO_PIN.value = True + def ldo_on(): global _LDO_PIN _LDO_PIN.value = True + def ldo_off(): global _LDO_PIN _LDO_PIN.value = False