From 52b3e1faba958b351dc0bb040b2eee1fabb45007 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 14 May 2020 21:03:49 -0500 Subject: [PATCH 01/13] actions: upload artifacts for stubs & docs --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4216f61392..de3aa5a9e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,16 @@ jobs: working-directory: tests - name: Stubs run: make stubs -j2 + - uses: actions/upload-artifact@v2 + with: + name: stubs + path: circuitpython-stubs* - name: Docs run: sphinx-build -E -W -b html . _build/html + - uses: actions/upload-artifact@v2 + with: + name: docs + path: _build/html - name: Translations run: make check-translate - name: New boards check From c08702414e410769de3d4821aa07f419c9ef7508 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Wed, 10 Jun 2020 16:36:44 -0400 Subject: [PATCH 02/13] Add macros for setting correct F7 and H7 I2C timing --- ports/stm/boards/nucleo_f746zg/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_f767zi/mpconfigboard.h | 4 ++++ ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h | 6 ++++++ ports/stm/boards/openmv_h7/mpconfigboard.h | 4 ++++ ports/stm/boards/stm32f746g_discovery/mpconfigboard.h | 4 ++++ ports/stm/common-hal/busio/I2C.c | 8 +++++++- 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index e2b54335a5..13ec369bf3 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,9 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index 327651923a..b08a0062e2 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,6 +40,10 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x6000030D +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 2ac986701e..15186e89d6 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,6 +39,12 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + + + #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 77ae235ecf..2f61e24213 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,5 +39,9 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 + #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 769990a98c..35a28ca3d1 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,6 +50,10 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#define CPY_I2CFAST_TIMINGR 0x00401959 +#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF + #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 48c4c1933a..01d0703ca1 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -120,7 +120,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // Handle the HAL handle differences #if (CPY_STM32H7 || CPY_STM32F7) - self->handle.Init.Timing = 0x40604E73; //Taken from STCube examples + if (frequency == 400000) { + self->handle.Init.Timing = CPY_I2CFAST_TIMINGR; + } else if (frequency == 100000) { + self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; + } else { + mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + } #else self->handle.Init.ClockSpeed = frequency; self->handle.Init.DutyCycle = I2C_DUTYCYCLE_2; From 724637faa3b96b20f4deed32d58dcb7b50672479 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Thu, 11 Jun 2020 11:17:51 -0400 Subject: [PATCH 03/13] Move I2C speed to clock-style definition --- .../stm/boards/nucleo_f746zg/mpconfigboard.h | 4 --- .../stm/boards/nucleo_f767zi/mpconfigboard.h | 4 --- .../boards/nucleo_h743zi_2/mpconfigboard.h | 6 ---- ports/stm/boards/openmv_h7/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 3 +- ports/stm/peripherals/clocks.h | 30 +++++++++++++++++++ .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 +++++ .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 +++++ .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 +++++ 9 files changed, 56 insertions(+), 19 deletions(-) diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index 13ec369bf3..e2b54335a5 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,9 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define DEBUG_UART_TX (&pin_PD08) #define DEBUG_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h index b08a0062e2..327651923a 100644 --- a/ports/stm/boards/nucleo_f767zi/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f767zi/mpconfigboard.h @@ -40,10 +40,6 @@ #define CPY_SRAM_SUBMASK 0xFC // Mask 512 to 384 #define CPY_SRAM_START_ADDR 0x20020000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x6000030D -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h index 15186e89d6..2ac986701e 100644 --- a/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h +++ b/ports/stm/boards/nucleo_h743zi_2/mpconfigboard.h @@ -39,12 +39,6 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - - - #define HSE_VALUE ((uint32_t)8000000) #define LSE_VALUE ((uint32_t)32768) #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal diff --git a/ports/stm/boards/openmv_h7/mpconfigboard.h b/ports/stm/boards/openmv_h7/mpconfigboard.h index 2f61e24213..77ae235ecf 100644 --- a/ports/stm/boards/openmv_h7/mpconfigboard.h +++ b/ports/stm/boards/openmv_h7/mpconfigboard.h @@ -39,9 +39,5 @@ #define CPY_SRAM_SUBMASK 0x00 #define CPY_SRAM_START_ADDR 0x24000000 -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 - #define HSE_VALUE ((uint32_t)12000000) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 01d0703ca1..00f15aaa60 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,6 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" +#include "clocks.h" // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 @@ -125,7 +126,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } else if (frequency == 100000) { self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; } else { - mp_raise_ValueError(translate("MCU supports only I2C Standard and Fast modes")); + mp_raise_ValueError(translate("Unsupported baudrate")); } #else self->handle.Init.ClockSpeed = frequency; diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 1f837c79ee..192190e5ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,4 +24,34 @@ * THE SOFTWARE. */ +// F4 Series +#ifdef STM32F401xE +#include "stm32f4/stm32f401xe/clocks.h" +#endif +#ifdef STM32F411xE +#include "stm32f4/stm32f411xe/clocks.h" +#endif +#ifdef STM32F412Zx +#include "stm32f4/stm32f412zx/clocks.h" +#endif +#ifdef STM32F405xx +#include "stm32f4/stm32f405xx/clocks.h" +#endif +#ifdef STM32F407xx +#include "stm32f4/stm32f407xx/clocks.h" +#endif + +// F7 Series +#ifdef STM32F746xx +#include "stm32f7/stm32f746xx/clocks.h" +#endif +#ifdef STM32F767xx +#include "stm32f7/stm32f767xx/clocks.h" +#endif + +// H7 Series +#ifdef STM32H743xx +#include "stm32h7/stm32h743xx/clocks.h" +#endif + void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index eb44625143..bd53c38cd9 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index 187a024ad0..a89756db05 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,3 +61,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index ad241b7ef6..e7c5170966 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,3 +68,11 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif + +// Obtain I2C timing values for F7 and H7 boards from ST CubeMX +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif From 3c3cad5ae6f050150931373e1472098671779973 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 11:11:44 -0500 Subject: [PATCH 04/13] docs: Improve 5.0.x <-> main branch doc linkrot This improves, but does not entirely fix, the broken links that result from the autoapi change. It fixes module-level links, but class links still do not work (e.g., /shared-bindings/displayio/Palette.html (5.0.x) is now just /shared-bindings/displayio/#displayio.Palette). --- .gitignore | 1 + conf.py | 1 + ports/atmel-samd/README.rst | 2 +- shared-bindings/index.rst | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f5edb89f0e..8a773970d3 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ _build ###################### genrst/ /autoapi/ +/shared-bindings/**/*.rst # ctags and similar ################### diff --git a/conf.py b/conf.py index 3980ea8e1b..06aab271b2 100644 --- a/conf.py +++ b/conf.py @@ -79,6 +79,7 @@ autoapi_add_toctree_entry = False autoapi_options = ['members', 'undoc-members', 'private-members', 'show-inheritance', 'special-members', 'show-module-summary'] autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True +autoapi_root = "shared-bindings" # The encoding of source files. #source_encoding = 'utf-8-sig' diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index a6881902e9..0746d1de06 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -21,4 +21,4 @@ Port Specific modules --------------------- .. toctree:: - ../../autoapi/samd/index + ../../shared-bindings/samd/index diff --git a/shared-bindings/index.rst b/shared-bindings/index.rst index d941773943..bf04ae18b1 100644 --- a/shared-bindings/index.rst +++ b/shared-bindings/index.rst @@ -19,5 +19,5 @@ Modules :glob: :maxdepth: 2 - ../autoapi/*/index + ../shared-bindings/*/index help From f83b0c2507611a95ab4dea0c87b25ba85a0de9d6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 12:56:22 -0500 Subject: [PATCH 05/13] docs: conf.py: alphabetize imports --- conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 06aab271b2..99423841b8 100644 --- a/conf.py +++ b/conf.py @@ -14,11 +14,12 @@ # serve to show the default. import json -import sys import os +import subprocess +import sys +import urllib.parse import recommonmark -import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the From cb8539b06dd4bce11207341a311bffca741d190c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:21 -0500 Subject: [PATCH 06/13] docs: Generate redirects for autoapi renaming --- conf.py | 45 ++++++++++++++++++++++ docs/redirects.txt | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 docs/redirects.txt diff --git a/conf.py b/conf.py index 99423841b8..d39f74bd7d 100644 --- a/conf.py +++ b/conf.py @@ -14,6 +14,7 @@ # serve to show the default. import json +import logging import os import subprocess import sys @@ -82,6 +83,8 @@ autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" +redirects_file = 'docs/redirects.txt' + # The encoding of source files. #source_encoding = 'utf-8-sig' @@ -376,5 +379,47 @@ intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), "bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} +# Adapted from sphinxcontrib-redirects +from sphinx.builders import html as builders + +TEMPLATE = """ + + +""" + + +def generate_redirects(app): + path = os.path.join(app.srcdir, app.config.redirects_file) + if not os.path.exists(path): + app.info("Could not find redirects file at '%s'" % path) + return + + # TODO(stephenfin): Add support for DirectoryHTMLBuilder + if not type(app.builder) == builders.StandaloneHTMLBuilder: + logging.warn("The 'sphinxcontib-redirects' plugin is only supported " + "by the 'html' builder. Skipping...") + return + + with open(path) as redirects: + for line in redirects.readlines(): + from_path, to_path = line.rstrip().split(' ') + + logging.debug("Redirecting '%s' to '%s'" % (from_path, to_path)) + + from_path = os.path.splitext(from_path)[0] + ".html" + to_path_prefix = '..%s' % os.path.sep * ( + len(from_path.split(os.path.sep)) - 1) + to_path = to_path_prefix + to_path + + redirected_filename = os.path.join(app.builder.outdir, from_path) + redirected_directory = os.path.dirname(redirected_filename) + if not os.path.exists(redirected_directory): + os.makedirs(redirected_directory) + + with open(redirected_filename, 'w') as f: + f.write(TEMPLATE % urllib.parse.quote(to_path, '#/')) + def setup(app): app.add_css_file("customstyle.css") + app.add_config_value('redirects_file', 'redirects', 'env') + app.connect('builder-inited', generate_redirects) diff --git a/docs/redirects.txt b/docs/redirects.txt new file mode 100644 index 0000000000..68d0b2de2e --- /dev/null +++ b/docs/redirects.txt @@ -0,0 +1,94 @@ +shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn +shared-bindings/fontio/BuiltinFont.rst shared-bindings/fontio/#fontio.BuiltinFont +shared-bindings/fontio/Glyph.rst shared-bindings/fontio/#fontio.Glyph +shared-bindings/aesio/AES.rst shared-bindings/aesio/#aesio.AES +shared-bindings/supervisor/Runtime.rst shared-bindings/supervisor/#supervisor.Runtime +shared-bindings/terminalio/Terminal.rst shared-bindings/terminalio/#terminalio.Terminal +shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut +shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift +shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle +shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon +shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle +shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape +shared-bindings/displayio/Bitmap.rst shared-bindings/displayio/#displayio.Bitmap +shared-bindings/displayio/ColorConverter.rst shared-bindings/displayio/#displayio.ColorConverter +shared-bindings/displayio/Display.rst shared-bindings/displayio/#displayio.Display +shared-bindings/displayio/EPaperDisplay.rst shared-bindings/displayio/#displayio.EPaperDisplay +shared-bindings/displayio/FourWire.rst shared-bindings/displayio/#displayio.FourWire +shared-bindings/displayio/Group.rst shared-bindings/displayio/#displayio.Group +shared-bindings/displayio/I2CDisplay.rst shared-bindings/displayio/#displayio.I2CDisplay +shared-bindings/displayio/OnDiskBitmap.rst shared-bindings/displayio/#displayio.OnDiskBitmap +shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palette +shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus +shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape +shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid +shared-bindings/_pixelbuf/PixelBuf.rst shared-bindings/_pixelbuf/#_pixelbuf.PixelBuf +shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad +shared-bindings/_pew/PewPew.rst shared-bindings/_pew/#_pew.PewPew +shared-bindings/rotaryio/IncrementalEncoder.rst shared-bindings/rotaryio/#rotaryio.IncrementalEncoder +shared-bindings/audiomixer/Mixer.rst shared-bindings/audiomixer/#audiomixer.Mixer +shared-bindings/audiomixer/MixerVoice.rst shared-bindings/audiomixer/#audiomixer.MixerVoice +shared-bindings/pulseio/PWMOut.rst shared-bindings/pulseio/#pulseio.PWMOut +shared-bindings/pulseio/PulseIn.rst shared-bindings/pulseio/#pulseio.PulseIn +shared-bindings/pulseio/PulseOut.rst shared-bindings/pulseio/#pulseio.PulseOut +shared-bindings/time/struct_time.rst shared-bindings/time/#time.struct_time +shared-bindings/i2cslave/I2CSlave.rst shared-bindings/i2cslave/#i2cslave.I2CSlave +shared-bindings/i2cslave/I2CSlaveRequest.rst shared-bindings/i2cslave/#i2cslave.I2CSlaveRequest +shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray +shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C +shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire +shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI +shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART +shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity +shared-bindings/ulab/array.rst shared-bindings/ulab/#ulab.array +shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode +shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer +shared-bindings/audioio/AudioOut.rst shared-bindings/audioio/#audioio.AudioOut +shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 +shared-bindings/touchio/TouchIn.rst shared-bindings/touchio/#touchio.TouchIn +shared-bindings/rgbmatrix/RGBMatrix.rst shared-bindings/rgbmatrix/#rgbmatrix.RGBMatrix +shared-bindings/audiomp3/MP3.rst shared-bindings/audiomp3/#audiomp3.MP3 +shared-bindings/usb_midi/PortIn.rst shared-bindings/usb_midi/#usb_midi.PortIn +shared-bindings/usb_midi/PortOut.rst shared-bindings/usb_midi/#usb_midi.PortOut +shared-bindings/usb_hid/Device.rst shared-bindings/usb_hid/#usb_hid.Device +shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K +shared-bindings/_bleio/BluetoothError.rst shared-bindings/_bleio/#_bleio.BluetoothError +shared-bindings/_bleio/ConnectionError.rst shared-bindings/_bleio/#_bleio.ConnectionError +shared-bindings/_bleio/RoleError.rst shared-bindings/_bleio/#_bleio.RoleError +shared-bindings/_bleio/SecurityError.rst shared-bindings/_bleio/#_bleio.SecurityError +shared-bindings/_bleio/Adapter.rst shared-bindings/_bleio/#_bleio.Adapter +shared-bindings/_bleio/Address.rst shared-bindings/_bleio/#_bleio.Address +shared-bindings/_bleio/Attribute.rst shared-bindings/_bleio/#_bleio.Attribute +shared-bindings/_bleio/Characteristic.rst shared-bindings/_bleio/#_bleio.Characteristic +shared-bindings/_bleio/CharacteristicBuffer.rst shared-bindings/_bleio/#_bleio.CharacteristicBuffer +shared-bindings/_bleio/Connection.rst shared-bindings/_bleio/#_bleio.Connection +shared-bindings/_bleio/Descriptor.rst shared-bindings/_bleio/#_bleio.Descriptor +shared-bindings/_bleio/PacketBuffer.rst shared-bindings/_bleio/#_bleio.PacketBuffer +shared-bindings/_bleio/ScanEntry.rst shared-bindings/_bleio/#_bleio.ScanEntry +shared-bindings/_bleio/ScanResults.rst shared-bindings/_bleio/#_bleio.ScanResults +shared-bindings/_bleio/Service.rst shared-bindings/_bleio/#_bleio.Service +shared-bindings/_bleio/UUID.rst shared-bindings/_bleio/#_bleio.UUID +shared-bindings/socket/socket.rst shared-bindings/socket/#socket.socket +shared-bindings/microcontroller/Pin.rst shared-bindings/microcontroller/#microcontroller.Pin +shared-bindings/microcontroller/Processor.rst shared-bindings/microcontroller/#microcontroller.Processor +shared-bindings/microcontroller/RunMode.rst shared-bindings/microcontroller/#microcontroller.RunMode +shared-bindings/audiocore/RawSample.rst shared-bindings/audiocore/#audiocore.RawSample +shared-bindings/audiocore/WaveFile.rst shared-bindings/audiocore/#audiocore.WaveFile +shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebufferio/#framebufferio.FramebufferDisplay +shared-bindings/audiobusio/I2SOut.rst shared-bindings/audiobusio/#audiobusio.I2SOut +shared-bindings/audiobusio/PDMIn.rst shared-bindings/audiobusio/#audiobusio.PDMIn +shared-bindings/countio/Counter.rst shared-bindings/countio/#countio.Counter +shared-bindings/storage/VfsFat.rst shared-bindings/storage/#storage.VfsFat +shared-bindings/digitalio/DigitalInOut.rst shared-bindings/digitalio/#digitalio.DigitalInOut +shared-bindings/digitalio/Direction.rst shared-bindings/digitalio/#digitalio.Direction +shared-bindings/digitalio/DriveMode.rst shared-bindings/digitalio/#digitalio.DriveMode +shared-bindings/digitalio/Pull.rst shared-bindings/digitalio/#digitalio.Pull +shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C +shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire +shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI +shared-bindings/rtc/RTC.rst shared-bindings/rtc/#rtc.RTC +shared-bindings/analogio/AnalogIn.rst shared-bindings/analogio/#analogio.AnalogIn +shared-bindings/analogio/AnalogOut.rst shared-bindings/analogio/#analogio.AnalogOut +shared-bindings/_stage/Layer.rst shared-bindings/_stage/#_stage.Layer +shared-bindings/_stage/Text.rst shared-bindings/_stage/#_stage.Text +shared-bindings/samd/Clock.rst shared-bindings/samd/#samd.Clock From 32a29ffdff4f757b818be9d63df44366a9ea389c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 13:04:58 -0500 Subject: [PATCH 07/13] shared-bindings: Change docstrings with '\x...' chars to raw strings Closes: #3032 --- shared-bindings/_bleio/Address.c | 2 +- shared-bindings/displayio/Display.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- shared-bindings/nvm/ByteArray.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index ccbab1b9d2..9beaff2ab2 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -78,7 +78,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, } //| address_bytes: Any = ... -//| """The bytes that make up the device address (read-only). +//| r"""The bytes that make up the device address (read-only). //| //| Note that the ``bytes`` object returned is in little-endian order: //| The least significant byte is ``address_bytes[0]``. So the address will diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 62ef0f5d00..6e454f34bd 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -50,7 +50,7 @@ //| contain the initialization sequence at minimum.""" //| //| def __init__(self, display_bus: Any, init_sequence: buffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, set_vertical_scroll: int = 0, backlight_pin: microcontroller.Pin = None, brightness_command: int = None, brightness: bool = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60): -//| """Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| r"""Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a //| command byte followed by a byte to determine the parameter count and if a delay is need after. diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 871b2b06af..37cfbd82e9 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -85,7 +85,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } //| def __setitem__(self, index: Any, value: Any) -> Any: -//| """Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. +//| r"""Sets the pixel color at the given index. The index should be an integer in the range 0 to color_count-1. //| //| The value argument represents a color, and can be from 0x000000 to 0xFFFFFF (to represent an RGB value). //| Value can be an int, bytes (3 bytes (RGB) or 4 bytes (RGB + pad byte)), bytearray, diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 326f719a83..06d7d4c95b 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -32,7 +32,7 @@ #include "supervisor/shared/translate.h" //| class ByteArray: -//| """Presents a stretch of non-volatile memory as a bytearray. +//| r"""Presents a stretch of non-volatile memory as a bytearray. //| //| Non-volatile memory is available as a byte array that persists over reloads //| and power cycles. Each assignment causes an erase and write cycle so its recommended to assign From 03c04e77ae5f94750408009cfa91f06b96a5898d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 14 Jun 2020 18:54:05 -0500 Subject: [PATCH 08/13] actions: Try checkout v2.2.0 This version is supposed to > Fetch all history for all tags and branches when fetch-depth=0 We leave the tags fetch in place so that actions _in cloned repos_ work. Cloned repos' tags do not necessarily match adafruit/circuitpython, but we want version reporting to be able to use adafruit/circuitpython tags when they are most relevant according to "git describe"'s heuristics. Submodules are different, as they always point to the repo specified in .gitmodules, so they don't need special handling to get the most relevant tags. --- .github/workflows/build.yml | 25 +++++-------------------- .github/workflows/create_website_pr.yml | 3 +-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00454cc2da..ae73b3a655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,14 +16,11 @@ jobs: env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Set up Python 3.8 @@ -110,14 +107,11 @@ jobs: gcc --version python3 --version msgfmt --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Build mpy-cross @@ -286,14 +280,11 @@ jobs: gcc --version arm-none-eabi-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -337,14 +328,11 @@ jobs: gcc --version riscv64-unknown-elf-gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: mpy-cross run: make -C mpy-cross -j2 - name: build @@ -377,14 +365,11 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule sync - - run: git submodule foreach git remote -v - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - uses: actions/cache@v1 diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 79a6c68a75..9907c08ae6 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -23,12 +23,11 @@ jobs: run: | gcc --version python3 --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v2.2.0 with: submodules: true fetch-depth: 0 - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/* - - run: git submodule foreach git fetch --recurse-submodules=no origin +refs/tags/*:refs/tags/* - name: CircuitPython version run: git describe --dirty --tags - name: Website From 2aac3cbdceffbeb1d70ac9de1412a29335f18158 Mon Sep 17 00:00:00 2001 From: Lucian Copeland Date: Mon, 15 Jun 2020 13:51:09 -0400 Subject: [PATCH 09/13] Revert I2C timing overrides, reduce scope to module only --- .../stm32f746g_discovery/mpconfigboard.h | 4 --- ports/stm/common-hal/busio/I2C.c | 19 +++++++++++- ports/stm/peripherals/clocks.h | 30 ------------------- .../peripherals/stm32f7/stm32f746xx/clocks.h | 8 ----- .../peripherals/stm32f7/stm32f767xx/clocks.h | 8 ----- .../peripherals/stm32h7/stm32h743xx/clocks.h | 8 ----- 6 files changed, 18 insertions(+), 59 deletions(-) diff --git a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h index 35a28ca3d1..769990a98c 100644 --- a/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f746g_discovery/mpconfigboard.h @@ -50,10 +50,6 @@ #define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_6) #define CPY_CLK_USB_USES_AUDIOPLL (1) -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#define CPY_I2CFAST_TIMINGR 0x00401959 -#define CPY_I2CSTANDARD_TIMINGR 0x00C0EAFF - #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 00f15aaa60..6adcf55750 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -33,7 +33,24 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -#include "clocks.h" + +// I2C timing specs for the H7 and F7 +// Configured for maximum possible clock settings for the family +#if (CPY_STM32F7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x6000030D +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x20404768 +#endif +#elif (CPY_STM32H7) +#ifndef CPY_I2CFAST_TIMINGR +#define CPY_I2CFAST_TIMINGR 0x00B03FDB +#endif +#ifndef CPY_I2CSTANDARD_TIMINGR +#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 +#endif +#endif // Arrays use 0 based numbering: I2C1 is stored at index 0 #define MAX_I2C 4 diff --git a/ports/stm/peripherals/clocks.h b/ports/stm/peripherals/clocks.h index 192190e5ee..1f837c79ee 100644 --- a/ports/stm/peripherals/clocks.h +++ b/ports/stm/peripherals/clocks.h @@ -24,34 +24,4 @@ * THE SOFTWARE. */ -// F4 Series -#ifdef STM32F401xE -#include "stm32f4/stm32f401xe/clocks.h" -#endif -#ifdef STM32F411xE -#include "stm32f4/stm32f411xe/clocks.h" -#endif -#ifdef STM32F412Zx -#include "stm32f4/stm32f412zx/clocks.h" -#endif -#ifdef STM32F405xx -#include "stm32f4/stm32f405xx/clocks.h" -#endif -#ifdef STM32F407xx -#include "stm32f4/stm32f407xx/clocks.h" -#endif - -// F7 Series -#ifdef STM32F746xx -#include "stm32f7/stm32f746xx/clocks.h" -#endif -#ifdef STM32F767xx -#include "stm32f7/stm32f767xx/clocks.h" -#endif - -// H7 Series -#ifdef STM32H743xx -#include "stm32h7/stm32h743xx/clocks.h" -#endif - void stm32_peripherals_clocks_init(void); diff --git a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h index bd53c38cd9..eb44625143 100644 --- a/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f746xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h index a89756db05..187a024ad0 100644 --- a/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h +++ b/ports/stm/peripherals/stm32f7/stm32f767xx/clocks.h @@ -61,11 +61,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x6000030D -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x20404768 -#endif diff --git a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h index e7c5170966..ad241b7ef6 100644 --- a/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h +++ b/ports/stm/peripherals/stm32h7/stm32h743xx/clocks.h @@ -68,11 +68,3 @@ #ifndef BOARD_HSE_SOURCE #define BOARD_HSE_SOURCE (RCC_HSE_ON) #endif - -// Obtain I2C timing values for F7 and H7 boards from ST CubeMX -#ifndef CPY_I2CFAST_TIMINGR -#define CPY_I2CFAST_TIMINGR 0x00B03FDB -#endif -#ifndef CPY_I2CSTANDARD_TIMINGR -#define CPY_I2CSTANDARD_TIMINGR 0x307075B1 -#endif From 81896930c7a91447c8830003e8cf92dce28db3d4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 16:35:51 -0400 Subject: [PATCH 10/13] Fix ScanEntry prefix matching for all --- shared-module/_bleio/ScanEntry.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 785209c4ab..91712baadc 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -56,12 +56,19 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (prefixes_length == 0) { return true; } + if (len == 0) { + // Prefixes exist, but no data. + return false; + } size_t i = 0; while(i < prefixes_length) { uint8_t prefix_length = prefixes[i]; i += 1; size_t j = 0; + bool prefix_matched = false; + mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { + mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -71,13 +78,21 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t if (any) { return true; } - } else if (!any) { - return false; + prefix_matched = true; + mp_printf(&mp_plat_print," match\n"); // XXX + break; } j += structure_length; } + // If all (!any), the current prefix must have matched at least one field. + if (!prefix_matched && !any) { + mp_printf(&mp_plat_print," Date: Mon, 15 Jun 2020 16:50:33 -0500 Subject: [PATCH 11/13] docs: conf.py: Remove an irrelevant TODO This TODO made sense in the context of the original project, but for use in CircuitPython it does not appear to be relevant. Remove it. --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index d39f74bd7d..38546a5d0a 100644 --- a/conf.py +++ b/conf.py @@ -394,7 +394,6 @@ def generate_redirects(app): app.info("Could not find redirects file at '%s'" % path) return - # TODO(stephenfin): Add support for DirectoryHTMLBuilder if not type(app.builder) == builders.StandaloneHTMLBuilder: logging.warn("The 'sphinxcontib-redirects' plugin is only supported " "by the 'html' builder. Skipping...") From c91435eff2e0ec0fa92fb383e2e96a18237d5c3f Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 15 Jun 2020 18:10:34 -0400 Subject: [PATCH 12/13] remove debugging prints --- shared-module/_bleio/ScanEntry.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared-module/_bleio/ScanEntry.c b/shared-module/_bleio/ScanEntry.c index 91712baadc..af9e4b3471 100644 --- a/shared-module/_bleio/ScanEntry.c +++ b/shared-module/_bleio/ScanEntry.c @@ -66,9 +66,7 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t i += 1; size_t j = 0; bool prefix_matched = false; - mp_printf(&mp_plat_print,"i %d\n", i); // XXX while (j < len) { - mp_printf(&mp_plat_print," j %d\n", j); // XXX uint8_t structure_length = data[j]; j += 1; if (structure_length == 0) { @@ -79,20 +77,17 @@ bool bleio_scanentry_data_matches(const uint8_t* data, size_t len, const uint8_t return true; } prefix_matched = true; - mp_printf(&mp_plat_print," match\n"); // XXX break; } j += structure_length; } // If all (!any), the current prefix must have matched at least one field. if (!prefix_matched && !any) { - mp_printf(&mp_plat_print," Date: Tue, 16 Jun 2020 12:33:15 -0400 Subject: [PATCH 13/13] Add port D to LQFP64 --- ports/stm/common-hal/microcontroller/Pin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm/common-hal/microcontroller/Pin.c b/ports/stm/common-hal/microcontroller/Pin.c index 6102134978..e966f709f6 100644 --- a/ports/stm/common-hal/microcontroller/Pin.c +++ b/ports/stm/common-hal/microcontroller/Pin.c @@ -46,8 +46,8 @@ bool neopixel_in_use; #define GPIO_PORT_COUNT 5 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE}; #elif defined(LQFP64) - #define GPIO_PORT_COUNT 3 - GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; + #define GPIO_PORT_COUNT 4 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD}; #elif defined(UFQFPN48) #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC};