Skip to content

Commit 541c2a7

Browse files
authored
Merge pull request #1938 from dhalbert/4.0.x-merge-to-master-2019-06-11
Merge latest 4.0.x changes to master
2 parents c85e111 + 4fc189b commit 541c2a7

File tree

28 files changed

+342
-21
lines changed

28 files changed

+342
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ git:
2121
# that SDK is shortest and add it there. In the case of major re-organizations,
2222
# just try to make the builds "about equal in run time"
2323
env:
24-
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr" TRAVIS_SDK=arm:nrf
24+
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr electronut_labs_blip" TRAVIS_SDK=arm:nrf
2525
- TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0" TRAVIS_SDK=arm
2626
- TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech" TRAVIS_SDK=arm
2727
- TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1" TRAVIS_SDK=arm

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile for Sphinx documentation
1+
# Top-level Makefile for documentation builds and miscellaneous tasks.
22
#
33

44
# You can set these variables from the command line.
@@ -215,3 +215,7 @@ check-translate: locale/circuitpython.pot $(wildcard locale/*.po)
215215
stubs:
216216
rst2pyi $(VALIDATE) shared-bindings/ $(STUBDIR)
217217
python setup.py sdist
218+
219+
update-frozen-libraries:
220+
@echo "Updating all frozen libraries to latest tagged version."
221+
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done

main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ void gc_collect(void) {
455455
// This collects root pointers from the VFS mount table. Some of them may
456456
// have lost their references in the VM even though they are mounted.
457457
gc_collect_root((void**)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t));
458+
459+
#if CIRCUITPY_DISPLAYIO
460+
displayio_gc_collect();
461+
#endif
462+
458463
// This naively collects all object references from an approximate stack
459464
// range.
460465
gc_collect_root((void**)sp, ((uint32_t)&_estack - sp) / sizeof(uint32_t));

ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor
2828
# Tweak inlining depending on language.
2929
ifeq ($(TRANSLATION), zh_Latn_pinyin)
3030
CFLAGS_INLINE_LIMIT = 25
31+
RELEASE_NEEDS_CLEAN_BUILD = 1
3132
else
3233
CFLAGS_INLINE_LIMIT = 55
3334
endif

ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ CHIP_FAMILY = samd21
2020

2121
# Tweak inlining depending on language.
2222
ifeq ($(TRANSLATION), zh_Latn_pinyin)
23-
CFLAGS_INLINE_LIMIT = 35
23+
CFLAGS_INLINE_LIMIT = 23
24+
RELEASE_NEEDS_CLEAN_BUILD = 1
2425
else
2526
CFLAGS_INLINE_LIMIT = 55
2627
endif

ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ CHIP_FAMILY = samd21
1515
# Tweak inlining depending on language.
1616
ifeq ($(TRANSLATION), zh_Latn_pinyin)
1717
CFLAGS_INLINE_LIMIT = 60
18+
RELEASE_NEEDS_CLEAN_BUILD = 1
1819
endif

ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CHIP_FAMILY = samd21
1515
# Tweak inlining depending on language.
1616
ifeq ($(TRANSLATION), zh_Latn_pinyin)
1717
CFLAGS_INLINE_LIMIT = 45
18+
RELEASE_NEEDS_CLEAN_BUILD = 1
1819
else
1920
CFLAGS_INLINE_LIMIT = 70
2021
endif

ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ CHIP_FAMILY = samd21
1616
# Tweak inlining depending on language.
1717
ifeq ($(TRANSLATION), zh_Latn_pinyin)
1818
CFLAGS_INLINE_LIMIT = 50
19+
RELEASE_NEEDS_CLEAN_BUILD = 1
1920
endif

ports/atmel-samd/boards/pewpew10/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ CIRCUITPY_SMALL_BUILD = 1
2525
# Tweak inlining depending on language.
2626
ifeq ($(TRANSLATION), zh_Latn_pinyin)
2727
CFLAGS_INLINE_LIMIT = 40
28+
RELEASE_NEEDS_CLEAN_BUILD = 1
2829
endif

ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ EXTERNAL_FLASH_DEVICES = "W25Q32FV"
1616
# Tweak inlining depending on language.
1717
ifeq ($(TRANSLATION), zh_Latn_pinyin)
1818
CFLAGS_INLINE_LIMIT = 50
19+
RELEASE_NEEDS_CLEAN_BUILD = 1
1920
endif

ports/nrf/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ feather_nrf52840_express | s140 | Peripheral and Scanner | UF
7979
makerdiary_nrf52840_mdk | s140 | Peripheral and Scanner | pyocd or ARM mbed DAPLink
8080
makerdiary_nrf52840_mdk_usb_dongle | s140 | Peripheral and Scanner | DFU bootloader & nrfutil
8181
electronut_labs_papyr | s140 | Peripheral and Scanner | UF2 bootloader
82+
electronut_labs_blip | s140 | Peripheral and Scanner | Black Magic Probe
8283

8384
## Segger Targets
8485

ports/nrf/background.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "supervisor/usb.h"
3030
#include "supervisor/shared/stack.h"
3131

32-
#ifdef CIRCUITPY_DISPLAYIO
32+
#if CIRCUITPY_DISPLAYIO
3333
#include "shared-module/displayio/__init__.h"
3434
#endif
3535

@@ -48,7 +48,7 @@ void run_background_tasks(void) {
4848
filesystem_background();
4949
usb_background();
5050

51-
#ifdef CIRCUITPY_DISPLAYIO
51+
#if CIRCUITPY_DISPLAYIO
5252
displayio_refresh_displays();
5353
#endif
5454
running_background_tasks = false;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Setup
2+
3+
The `Electronut Labs Blip` board is a development board based on the `nRF52840` SoC from
4+
Nordic Semiconductors. It has a Black Magic Probe compatible programmer and debugger
5+
built in, along with temperature/humidity sensor, ambient light intensity sensor, and
6+
a 3-axis accelerometer. It can be used to prototype very low power devices. It also has
7+
provision for an SD card slot, which makes it a complete and versatile development board.
8+
9+
Schematic, datasheet, pin mapping etc. can be found over [here](https://docs.electronut.in/blip/).
10+
11+
Features:
12+
13+
* Raytac MDBT50Q-1M module based on Nordic Semiconductor's nRF52840
14+
* LIS2DDH12 High-performance 3-axis "femto" accelerometer
15+
* Optical Sensor LTR-329ALS-01
16+
* Si7006-A20 I2C humidity and temperature sensor
17+
* On board STM32F103CBT6 as Black magic probe debugger
18+
* NFC Antenna
19+
* MicroSD slot
20+
* Power Supply: USB, JST connector for Li-ion/Li-po
21+
* BQ24079 battery charging and power management IC
22+
23+
## Installing CircuitPython submodules
24+
25+
Before you can build, you will need to run the following commands once, which
26+
will install the submodules that are part of the CircuitPython ecosystem, and
27+
build the `mpy-cross` tool:
28+
29+
```
30+
$ cd circuitpython
31+
$ git submodule update --init
32+
$ make -C mpy-cross
33+
```
34+
35+
## Building and Flashing CircuitPython
36+
37+
No special notes for this, follow `ports/nrf` generic `README.md`.
38+
39+
### Flashing CircuitPython with GDB using on board Black magic probe debugger
40+
41+
```
42+
$ cd ports/nrf
43+
$ make V=1 SD=s140 SERIAL=/dev/ttyACM0 BOARD=electronut_labs_blip all
44+
...
45+
...
46+
LINK build-electronut_labs_blip-s140/firmware.elf
47+
48+
778588 bytes free in flash out of 1048576 bytes ( 1024.0 kb ).
49+
228320 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ).
50+
51+
Create build-electronut_labs_blip-s140/firmware.bin
52+
Create build-electronut_labs_blip-s140/firmware.hex
53+
Create build-electronut_labs_blip-s140/firmware.uf2
54+
python3 ../../tools/uf2/utils/uf2conv.py -f 0xADA52840 -c -o "build-electronut_labs_blip-s140/firmware.uf2" build-electronut_labs_blip-s140/firmware.hex
55+
Converting to uf2, output size: 540160, start address: 0x26000
56+
Wrote 540160 bytes to build-electronut_labs_blip-s140/firmware.uf2.
57+
```
58+
59+
Now you can use either `.hex` or `.elf` from the generated files inside
60+
`build-electronut_labs_blip-s140` directory. Now you can use `arm-none-eabi-gdb`
61+
to flash circuitpython on Blip.
62+
63+
### Other tips
64+
65+
Once circuitpython is running on your board, it will come up as a mass storage
66+
device named `CIRCUITPY`, where you can drop in your python code. The file names
67+
it looks for are `main.py`, `main.txt`, `code.py` or `code.txt`.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "boards/board.h"
28+
29+
void board_init(void) {
30+
}
31+
32+
bool board_requests_safe_mode(void) {
33+
return false;
34+
}
35+
36+
void reset_board(void) {
37+
38+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2016 Glenn Ruben Bakke
7+
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
8+
* Copyright (c) 2019 [email protected]
9+
*
10+
* Permission is hereby granted, free of charge, to any person obtaining a copy
11+
* of this software and associated documentation files (the "Software"), to deal
12+
* in the Software without restriction, including without limitation the rights
13+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
* copies of the Software, and to permit persons to whom the Software is
15+
* furnished to do so, subject to the following conditions:
16+
*
17+
* The above copyright notice and this permission notice shall be included in
18+
* all copies or substantial portions of the Software.
19+
*
20+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26+
* THE SOFTWARE.
27+
*/
28+
29+
#include "nrfx/hal/nrf_gpio.h"
30+
31+
#define ELECTRONUT_LABS_PAPYR
32+
33+
#define MICROPY_HW_BOARD_NAME "Electronut Labs Blip"
34+
#define MICROPY_HW_MCU_NAME "nRF52840"
35+
#define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr"
36+
37+
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
38+
39+
// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192
40+
41+
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
42+
43+
#define BOARD_HAS_CRYSTAL 1
44+
45+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
46+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_12)
47+
48+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_25)
49+
#define DEFAULT_SPI_BUS_MOSI (&pin_P1_02)
50+
#define DEFAULT_SPI_BUS_MISO (&pin_P0_24)
51+
52+
#define DEFAULT_UART_BUS_RX (&pin_P0_08)
53+
#define DEFAULT_UART_BUS_TX (&pin_P0_06)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x803C
3+
USB_PRODUCT = "Blip"
4+
USB_MANUFACTURER = "Electronut Labs"
5+
6+
MCU_SERIES = m4
7+
MCU_VARIANT = nrf52
8+
MCU_SUB_VARIANT = nrf52840
9+
MCU_CHIP = nrf52840
10+
SD ?= s140
11+
SOFTDEV_VERSION ?= 6.1.0
12+
13+
BOOT_SETTING_ADDR = 0xFF000
14+
15+
ifeq ($(SD),)
16+
LD_FILE = boards/nrf52840_1M_256k.ld
17+
else
18+
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
19+
CIRCUITPY_BLEIO = 1
20+
endif
21+
22+
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_03) },
5+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) },
6+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) },
7+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_29) },
8+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_30) },
9+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_31) },
10+
11+
{ MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) },
12+
{ MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) },
13+
14+
// odd row
15+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_02) },
16+
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_04) },
17+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_06) },
18+
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_08) },
19+
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_19) },
20+
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_21) },
21+
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_26) },
22+
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_27) },
23+
{ MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_29) },
24+
{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) },
25+
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_P1_01) },
26+
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_P1_04) },
27+
{ MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_P1_06) },
28+
29+
// even row
30+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_03) },
31+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) },
32+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) },
33+
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_16) },
34+
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_20) },
35+
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_22) },
36+
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_23) },
37+
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_28) },
38+
{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_30) },
39+
{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_P1_00) },
40+
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_P1_03) },
41+
{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_P1_05) },
42+
{ MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_P1_08) },
43+
44+
// SCL SDA as pins also
45+
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_11) },
46+
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_12) },
47+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) },
48+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) },
49+
50+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_25) },
51+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_24) },
52+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_02) },
53+
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_P0_17) },
54+
55+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) },
56+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) },
57+
58+
{ MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_14) },
59+
{ MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P0_14) },
60+
61+
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_15) },
62+
{ MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_P0_13) },
63+
64+
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P1_07) },
65+
{ MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&pin_P0_18) },
66+
67+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
68+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
69+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
70+
};
71+
72+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/nrf/supervisor/port.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,22 @@ void reset_port(void) {
9393
i2c_reset();
9494
spi_reset();
9595
uart_reset();
96+
97+
#if CIRCUITPY_PULSEIO
9698
pwmout_reset();
9799
pulseout_reset();
98100
pulsein_reset();
101+
#endif
102+
99103
timers_reset();
100104

101-
#if CIRCUITPY_RTC
105+
#if CIRCUITPY_RTC
102106
rtc_reset();
103-
#endif
107+
#endif
104108

109+
#if CIRCUITPY_BLEIO
105110
bleio_reset();
111+
#endif
106112

107113
reset_all_pins();
108114
}

0 commit comments

Comments
 (0)