Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 9fb56d15627e831f315e8afcbd5115c5506b10e0
Author: Mark Grosen <[email protected]>
Date:   Mon Jul 17 17:03:04 2023 -0700

    esp32/CMakeLists: Enable multiple extra component directories in build.

    The EXTRA_COMPONENT_DIRS variable is a list so adding a directory so should
    be done via append, not set.  This enables boards to use other components
    in the build. See:
    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#optional-project-variables

commit cc9735ad6a5c3e198eabb406ee8d8ec687d5ec59
Author: Luca Burelli <[email protected]>
Date:   Tue Jul 4 16:08:23 2023 +0200

    esp32/boards/ARDUINO_NANO_ESP32: Add support for Arduino Nano ESP32.

    Signed-off-by: Luca Burelli <[email protected]>

commit e0784750aab4bd71896d6683de00b15324b8cb0f
Author: Luca Burelli <[email protected]>
Date:   Tue Jul 4 12:24:35 2023 +0200

    shared/tinyusb: Avoid symbol clash on targets with external TinyUSB.

    On targets that provide a reference TinyUSB implementation, like ESP32,
    the SDK already defines and implements standard callback functions such
    as tud_cdc_line_state_cb(). This causes a symbol clash when enabling
    shared implementations like the MicroPython 1200 touch functionality.

    To avoid this symbol clash, add an optional macro to allow ports to
    use a different function name in the shared implementation.

    Signed-off-by: Luca Burelli <[email protected]>

commit 3d98f6b80a6d74ce31e33588f430a5ec17099620
Author: Luca Burelli <[email protected]>
Date:   Tue Jul 4 12:24:35 2023 +0200

    esp32/usb: Add custom TinyUSB callback support.

    Allow boards to define their own additional USB callbacks.

    Signed-off-by: Luca Burelli <[email protected]>

commit 904ccfaf9480b6ec8f0589bb14bb29d05e251bc0
Author: Luca Burelli <[email protected]>
Date:   Tue Jul 4 11:54:53 2023 +0200

    esp32/modmachine: Add generic machine.bootloader().

    Implement a standard machine.bootloader() method for ESP32-series devices.
    No default implementation, each board can enable it as required.

    Signed-off-by: Luca Burelli <[email protected]>

commit 31ef7c186bbac067d3bbcaf0876cbef113ee0df6
Author: Luca Burelli <[email protected]>
Date:   Wed Jul 5 18:03:11 2023 +0200

    esp32: Collect properties from IDF-managed components as well.

    Some targets like the ESP32-S3 use the IDF Component Manager to provide
    additional dependencies to the build.  Make sure to include these extra
    components when collecting properties used by MicroPython-specific build
    steps, like qstr preprocessing.

    Signed-off-by: Luca Burelli <[email protected]>

commit 4548928449c63f72fce5917c683664bf3ca0501f
Author: Angus Gratton <[email protected]>
Date:   Thu Feb 2 10:11:06 2023 +1100

    stm32/boards/B_L072Z_LRWAN1: Lower default ROM level to "Core".

    Re-enable some features required for the board to still build and the lora
    driver to run.

    This board only has 192KB of flash total, so default stm32 build is very
    close to the limit.

    Before:

    LINK build-B_L072Z_LRWAN1/firmware.elf
       text    data     bss     dec     hex filename
     184352      68   14112  198532   30784 build-B_L072Z_LRWAN1/firmware.elf

    (12256 bytes free)

    After:

    LINK build-B_L072Z_LRWAN1/firmware.elf
       text    data     bss     dec     hex filename
     155028      68   14052  169148   294bc build-B_L072Z_LRWAN1/firmware.elf

    (41580 bytes free)

    This work was funded through GitHub Sponsors.

    Signed-off-by: Angus Gratton <[email protected]>

commit 3aabdf2f6bc4119576248bc383d20da47e759748
Author: Angus Gratton <[email protected]>
Date:   Tue May 31 16:37:40 2022 +1000

    stm32/boards/B_L072Z_LRWAN1: Add pin definitions for internal SX1262.

    Includes fixing the SCK connection pin.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Angus Gratton <[email protected]>

commit cb31c0ae9c2a7eaadabfea3939aa8c3a07e36a67
Author: Damien George <[email protected]>
Date:   Sat Jul 15 00:03:59 2023 +1000

    esp32: Add support for board-named pins and the Pin.board dict.

    This adds named-pins support to the esp32 port, following other ports.
    Since the name of esp32 CPU pins is just GPIOx, where x is an integer, the
    Pin.cpu dict is not supported and CPU pins are just retrieved via their
    existing integer "name" (the cost of adding Pin.cpu is about 800 bytes,
    mostly due to the additional qstrs).

    What this commit supports is the Pin.board dict and constructing a pin by
    names given by a board.  These names are defined in a pins.csv file at the
    board level.  If no such file exists then Pin.board exists but is empty.

    As part of this commit, pin and pin IRQ objects are optimised to reduce
    their size in flash (by removing their gpio_num_t entry).  The net change
    in firmware size for this commit is about -132 bytes.

    Signed-off-by: Damien George <[email protected]>

commit 51c2d26f15c2a737f90f5e4f6581b2588e0930fc
Author: robert-hh <[email protected]>
Date:   Wed Jun 7 20:42:25 2023 +0200

    renesas-ra/machine_spi: Consistently use machine_pin_find to get pin.

    Sometimes mp_hal_get_pin_obj() was used.  machine_pin_find() is the
    internal name, and the external interface is mp_hal_get_pin_obj().

    Signed-off-by: robert-hh <[email protected]>

commit 9fea0e98b1910c17578341eb75694e5b12922392
Author: robert-hh <[email protected]>
Date:   Wed Jun 7 17:56:58 2023 +0200

    esp8266/machine_pin: Accept an integer argument to mp_obj_get_pin_obj.

    Allowing the machine.pwm() and esp.apa102() module to accept Pin(x) integer
    parameters.  Not so much of a gain, just consistent with other ports.

    Signed-off-by: robert-hh <[email protected]>

commit 29e9573de7200cc64654a77c2c20a57f89d11082
Author: robert-hh <[email protected]>
Date:   Wed Jun 7 15:10:11 2023 +0200

    esp32: Use always machine_pin_get_id for getting a Pin id.

    This applies to all machine modules which have pins as arguments.  Since
    machine_pin_get_id() calls pin_find(), these pin arguments may be at the
    moment either integer objects or Pin objects.  That allows for instance to
    write

        uart = UART(1, tx=Pin(4), rx=Pin(5))

    instead of

        uart = UART(1, tx=4, rx=5)

    which is consistent with other ports.  Since this handling is done at a
    single place in the code, extending that scheme to accept strings for named
    pins is easy.

    Signed-off-by: robert-hh <[email protected]>

commit 3819ee4a6f07aa01f6e9d41c6617b931499f406b
Author: robert-hh <[email protected]>
Date:   Wed Jun 7 14:58:56 2023 +0200

    esp32/machine_pin: Add a pin-find func and use it in machine_pin_get_id.

    The new machine_pin_find() function accepts a Pin object and a integer
    object as input and returns a pin object.  That can be extended later to
    accept a string object, once named pins are supported.

    Signed-off-by: robert-hh <[email protected]>

commit c02da6d81dcc668fd719dc78efb848388a561074
Author: robert-hh <[email protected]>
Date:   Tue Jun 6 21:47:46 2023 +0200

    rp2/machine_pin: Factor out pin-find code from machine_pin_make_new.

    And use it in mp_hal_get_pin_obj() and machine_pin_make_new().  That way,
    mp_hal_get_pin_obj() accepts both int and str objects as argument, allowing
    use of a pin specifier instead of a pin object in the constructor of
    devices which need a pin as parameter.

    E.g. instead of

        uart = UART(0, tx=Pin(0), rx=Pin(1))

    one can write:

        uart = UART(0, tx=0, rx=1)

    Signed-off-by: robert-hh <[email protected]>

commit 7d66ae603d91157069d7cdee065919a61f678fb9
Author: Damien George <[email protected]>
Date:   Wed Jul 12 16:39:26 2023 +1000

    esp32/machine_timer: Switch from legacy driver to timer HAL.

    The legacy driver was deprecated in IDF v5, and crashes when the ISR
    handler is called.  Instead of fixing the legacy code, this commit reworks
    the machine.Timer class to use the low-level HAL driver.

    Tested on ESP32, ESP32S2, ESP32S3 and ESP32C3.  Behaviour is the same as it
    was before this commit, except the way the Timer object is printed, it now
    gives more useful information (timer id, mode, period in ms).

    Fixes issue #11970.

    Signed-off-by: Damien George <[email protected]>

commit 671b35ceae2d2b7b64f755524b3a5a42e29abcfe
Author: Jim Mussared <[email protected]>
Date:   Tue Jul 4 11:43:14 2023 +1000

    py/builtinimport: Fix built-in imports when external import is disabled.

    Follow-up to 24c02c4eb5f11200f876bb57cd63a9d0bae91fd3 for when
    MICROPY_ENABLE_EXTERNAL_IMPORT=0.  It now needs to try both extensible and
    non-extensible modules.

    Signed-off-by: Jim Mussared <[email protected]>

commit 606ec9bfb1cca262cf5b936db78924a609f9e73d
Author: Damien George <[email protected]>
Date:   Fri May 19 17:00:53 2023 +1000

    py/compile: Fix async for's stack handling of iterator expression.

    Prior to this fix, async for assumed the iterator expression was a simple
    identifier, and used that identifier as a local to store the intermediate
    iterator object.  This is incorrect behaviour.

    This commit fixes the issue by keeping the iterator object on the stack as
    an anonymous local variable.

    Fixes issue #11511.

    Signed-off-by: Damien George <[email protected]>

commit 14c2b641312c7faec20b521b910a6354280ca068
Author: Nicholas H.Tollervey <[email protected]>
Date:   Tue Jul 11 18:05:28 2023 +0100

    webassembly: Replace typeof window check with ENVIRONMENT_IS_NODE flag.

    When the "typeof window" check is run within a web worker the window is
    undefined, causing an error because "require" is only defined in a Node
    environment.  Change the logic to reflect the true intentions of when this
    code should run, ie in Node only.

    Signed-off-by: Damien George <[email protected]>

commit 88771c150098df53aa6a3fedcdd25b11eeb4e134
Author: Damien George <[email protected]>
Date:   Thu Jul 13 13:18:09 2023 +1000

    renesas-ra,stm32: Remove duplicate machine module from constants list.

    In the u-module renaming done in 30628d1bb782006c88325a086ddfcd5c2e5ddbb4,
    these duplicate lines were accidentally left.

    Signed-off-by: Damien George <[email protected]>

commit 62673a7708083ab3d9452d67117b424cd4b81150
Author: Damien George <[email protected]>
Date:   Thu Jul 13 13:10:31 2023 +1000

    stm32/mpconfigport: Always define MICROPY_SOFT_TIMER_TICKS_MS.

    Even if MICROPY_PY_MACHINE is disabled, the soft timer is still used.

    Signed-off-by: Damien George <[email protected]>

commit 730525cec965a912354454ec015a3d043d5579d3
Author: Victor Rajewski <[email protected]>
Date:   Tue Jul 4 15:11:06 2023 +1000

    stm32/qspi: Allow qspi_write_cmd_data to write cmd with 1 data byte.

    The existing qspi for stm32 implementation can only send a spi command with
    exactly 0 or 2 data bytes.  Certain spiflash chips (e.g. AT25SF321B) have
    commands that only take a single data byte, and will ignore the command if
    more than that is sent.  This commit allows sending a command with a single
    data byte.

    Signed-off-by: Victor Rajewski <[email protected]>

commit 409978a1fb85968ac3a5eb0bc33788eb507dee14
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 12:01:01 2023 +0900

    stm32/adc: Fix pyb.ADCAll.read_core_bat on G4 and L4 MCUs.

    Update adc_refcor before reading ADC_CHANNEL_VBAT because VREFINT_CAL is at
    VDDA=3.0V.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit cb38f77918b7c7dde2904b7f13ad38aaf69d7350
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 11:14:00 2023 +0900

    stm32/adc: Add workaround for ADC errata with G4 MCUs.

    For STM32G4, there is a errata on ADC that may get wrong ADC result.
    According to the errata sheet, this can be avoid by performing two
    consecutive ADC conversions and keep second result.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit 0a31b9bf78b5ac57ef7c4df4a161779991106649
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 11:11:29 2023 +0900

    stm32/machine_adc: Fix machine.ADC to work on G4 MCUs.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit d9764ad1408f4cdf981a1e0f4db380a4cb4fe94c
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 11:04:20 2023 +0900

    stm32/adc: Fix reading internal ADC channels on G4 MCUs.

    For STM32G4 series, the internal sensors are connected to:
    - ADC1_IN16: Temperature sensor
    - ADC1_IN17: Battery voltage monitoring
    - ADC1_IN18: Internal voltage reference
    but ADC_CHANNEL_TEMPSENSOR_ADC1, ADC_CHANNEL_VBAT,
    ADC_CHANNEL_VREFINT are not defined as 16, 17, 18.

    This commit converts channel 16, 17, 18 to ADC_CHANNEL_x in
    adc_get_internal_channel().

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit 0ba94a67ba72f2e04bfc26dcf0ed687addd0d740
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 10:59:35 2023 +0900

    stm32/adc: Fix pyb.ADCAll.read_core_temp for G4 MCUs.

    For STM32G4,
     * TS_CAL1 raw data acquired at a temperature of 30°C
     * TS_CAL2 raw data acquired at a temperature of 130°C
    Also, these values are at VDDA=3.0V.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit de8035b51070f14b3af32870fb8eede97ddb4215
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 8 10:46:01 2023 +0900

    stm32/adc: Fix ADC clock prescaler for G4 MCUs.

    For STM32G4, ADC clock frequency should be equal or less than 60MHz.
    To satisfy this specification, ADC clock prescaler should be equal or
    greater than 4 (For example, NUCLEO_G474RE runs 170MHz).

    In addition, to obtain accurate internal channel value,
    the ADC clock prescaler is set to 16 because vbat needs at least 12us
    (16/170*247.5=23.3us).

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit ec9ea97413c6091c101c3ab10207ae4daf1c56db
Author: Yuuki NAGAO <[email protected]>
Date:   Sat Jul 1 10:25:18 2023 +0900

    stm32/dac: Fix dac.write_timed on G4 MCUs to use 32-bit DMA access.

    For STMG4 MCUs, the peripheral registers for DAC have to be accessed by
    words (32bits) because DAC is connected to AHB directly.

    (This requirement is also there for other MCU series.  However, if DAC is
    connected to APB like F4/L1/L4 MCUs, AHB byte or half-word transfer is
    changed into a 32-bit APB transfer.  This means that PSIZE does not have to
    be DMA_PDATAALIGN_WORD on these MCUs, and in fact must be BYTE/HALFWORD to
    function correctly.)

    Fixes issue #9563.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit cddeb5f0754e42f5e50da8ccefb5c073dce61be6
Author: Elvis Pfutzenreuter <[email protected]>
Date:   Thu Jul 6 23:50:30 2023 -0300

    docs/esp32/quickref: Add LAN example for WT32-ETH01 version 1.4.

    This board requires slightly different configuration to work.  It is
    important to hard reset (cycle power) if you try to initialize LAN and it
    fails, before trying again with new parameters.

    Discussion: https://github.com/orgs/micropython/discussions/11446

    AliExpress purchase link: https://pt.aliexpress.com/item/1005002023196214.html

    Signed-off-by: Elvis Pfutzenreuter <[email protected]>

commit dbced75b48d2fed969e4ee430a50cadf858eb4bf
Author: Glenn Moloney <[email protected]>
Date:   Sat Jul 1 13:54:44 2023 +1000

    esp32/network_wlan: Wait for STA/AP START/STOP event in wlan.active.

    This is a fix for commit bccbaa92b1fc6237f0f49a7f07cc194835fbf4e3:
    - Should only wait for WIFI_EVENT_STA_START when invoked on the STA_IF
      interface.
    - The WIFI_EVENT_STA_START event is generated every time the STA_IF
      interface is set active(True) and it was previously inactive, ie. not
      only after calling esp_wifi_start().
    - Also wait for WIFI_EVENT_STA_STOP when deactivating the interface.
    - Also wait for relevant AP events.

    Fixes issue #11910.

    Signed-off-by: Glenn Moloney <[email protected]>
    Signed-off-by: Damien George <[email protected]>

commit 2c67671651651363fc6f89a334508d0029758eef
Author: Damien George <[email protected]>
Date:   Wed Jul 12 00:12:13 2023 +1000

    esp32/boards/GENERIC_OTA: Enable silent checks to reduce firmware size.

    Enabling mDNS put this firmware over the limit of the OTA partition size,
    so tweak the compiler settings to reduce the firmware size.

    Signed-off-by: Damien George <[email protected]>

commit 1f35576a69e626bd9801f0e9ca6aa117405a39fc
Author: Carlosgg <[email protected]>
Date:   Sun Jun 25 22:48:39 2023 +0100

    esp32: Re-enable mDNS after move to IDF v5.0.2.

    mDNS was disabled in e4650125b88a35f074097f16d84a8f49bd22ac06.  This commit
    re-enables it.

    For reference see:
    https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/release-5.x/5.0/removed-components.html

    Signed-off-by: Carlos Gil <[email protected]>

commit 7bced2eaece1033cde8d6169555956214e92b542
Author: Damien George <[email protected]>
Date:   Tue Jul 11 13:45:53 2023 +1000

    stm32/modmachine: Make machine_reset_cause_obj public.

    To match the other functions in the machine module, in particular so that
    MICROPY_PY_MACHINE can be disabled without getting a compiler warning about
    unused code.

    Signed-off-by: Damien George <[email protected]>

commit dd8de8b41227c423330244f2a931d6bd98e63947
Author: Tobias Thyrrestrup <[email protected]>
Date:   Wed Jun 28 11:18:07 2023 +0200

    stm32/modmachine: Remove duplicate machine_timer_type declaration.

    Signed-off-by: Tobias Thyrrestrup <[email protected]>

commit a2c02014cd4df7cd2b7bea611b555d3a58a4d02f
Author: Yuuki NAGAO <[email protected]>
Date:   Tue Jun 27 22:20:12 2023 +0900

    stm32: Modify RCC->APB2ENR directly instead of HAL API.

    Also, it is needed only when USB is enabled.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit 7ca3c1d8920fc0a9ceef0a1d725009d1716e41fa
Author: Yuuki NAGAO <[email protected]>
Date:   Tue Jun 20 16:13:19 2023 +0900

    stm32: Add USB support for STM32L1 MCUs.

    Signed-off-by: Yuuki NAGAO <[email protected]>

commit 813d559bc098eeaa1c6e0fa1deff92e666c0b458
Author: elibdev <[email protected]>
Date:   Mon Jun 19 14:15:42 2023 -0400

    webassembly: Make mp_js_process_char asynchronous.

    This may also call the garbage collector.

    Signed-off-by: Eli Bierman <[email protected]>

commit b2ad7e238b4e6de86aef646d715cf9a8a5144807
Author: elibdev <[email protected]>
Date:   Mon Jun 19 11:56:38 2023 -0400

    webassembly: Make mp_js_do_str asynchronous.

    This fixes a bug where `gc.collect()` would crash due to
    emscripten_scan_stack being called synchronously within mp_js_do_str.  The
    fix is to make mp_js_do_str asynchronous.

    Fixes #10692.

    Signed-off-by: Eli Bierman <[email protected]>

commit 0e215a9fbab5f15f8c459062b5ec75de2a83f403
Author: robert-hh <[email protected]>
Date:   Mon Jun 26 20:26:59 2023 +0200

    samd/mpconfigport: Provide the platform module.

    Signed-off-by: robert-hh <[email protected]>

commit 057f3b00204cc88d31a66f7d5999fc3c29b92fe4
Author: robert-hh <[email protected]>
Date:   Mon Jun 26 14:16:47 2023 +0200

    samd/mpconfigport: Enable DHT and onewire drivers on all MCUs/boards.

    And move the setting to the samd-generic files, now that both samd21
    and samd51 support it.

    Signed-off-by: robert-hh <[email protected]>

commit 5ef7ce5116dd419b3f217fac5ab0cbf3634a028d
Author: robert-hh <[email protected]>
Date:   Mon Jun 26 14:13:25 2023 +0200

    samd/Makefile: Print memory region usage instead of totals.

    Signed-off-by: robert-hh <[email protected]>

commit cfaa9a4997b0d57357631a82d1e33205d26972d4
Author: robert-hh <[email protected]>
Date:   Fri Jun 9 16:30:08 2023 +0200

    samd/Makefile: Move the math lib files from mpconfigmcu.mk to Makefile.

    They are used by both SAMD21 and SAMD51.

    Signed-off-by: robert-hh <[email protected]>

commit 909fe30dfd32da71ac962f004d7626beb3c693d0
Author: robert-hh <[email protected]>
Date:   Fri Jun 9 12:40:39 2023 +0200

    samd: Set the LFS type in mpconfigmcu.mk instead of mpconfigboard.mk.

    SAMD21: set the filesystem type to LFS1.

    SAMD51: the type is already set to LFS2, support is now dropped for LFS1.
    It has not been used and dropping it saves 10 k of flash.

    Signed-off-by: robert-hh <[email protected]>

commit 5a9a0df3407cb195ff1f61cf9cba0fc8700c54c6
Author: Damien George <[email protected]>
Date:   Tue Jun 27 13:05:33 2023 +1000

    esp32/machine_uart: Always select a source_clk value in UART config.

    Fixes issue #11872.

    Signed-off-by: Damien George <[email protected]>

commit 761d86ae56d6b64f792df3a770167bfa05f3d0db
Author: mbedNoobNinja <[email protected]>
Date:   Thu Mar 2 18:08:31 2023 +0200

    renesas-ra/boards/VK_RA6M5: Add new board definition.

    Signed-off-by: mbedNoobNinja <[email protected]>

commit fae96b17a762608224a133067810ac461c3de14e
Author: mbedNoobNinja <[email protected]>
Date:   Thu Mar 2 18:08:31 2023 +0200

    renesas-ra: Add support for RA6M5, and add machine PWM, DAC, SDCard.

    This commit adds support for a new processor RA6M5.  It also adds the
    following classes to the machine module: PWM, DAC, SDCard.

    Signed-off-by: mbedNoobNinja <[email protected]>

commit 92c7532d8e461f3fd9ea44f4d024ee3ce156e5e8
Author: Takeo Takahashi <[email protected]>
Date:   Thu Jun 1 17:56:28 2023 +0900

    renesas-ra: Support changing baudrate for UART.

    * Use R_SCI_UART_BaudCalculate() of fsp/src/r_sci_uart/r_sci_uart.c
    * Support UART.init(baudrate)

    Signed-off-by: Takeo Takahashi <[email protected]>

commit 713a45124bd8cf161af7ecd8babda1aa030a8ba4
Author: Damien George <[email protected]>
Date:   Mon Jun 26 16:33:23 2023 +1000

    docs/library/ssl: Add documentation for SSLContext.

    Signed-off-by: Damien George <[email protected]>

commit 9900eaa2698ef493d15237cb737bdfcc51ac193f
Author: Damien George <[email protected]>
Date:   Sun Jun 25 15:28:09 2023 +1000

    tests/extmod: Add test for passing cadata into ssl.wrap_socket().

    For coverage.

    Signed-off-by: Damien George <[email protected]>

commit b50da3dbd7e98dfe5360684a55b342666c7683ca
Author: Damien George <[email protected]>
Date:   Sun Jun 25 14:16:20 2023 +1000

    tests/extmod: Add tests for ssl.SSLContext.

    Signed-off-by: Damien George <[email protected]>

commit e8a4c1dd537c7ccfba92936c6eee9d5cf529be9e
Author: Damien George <[email protected]>
Date:   Sun Jun 25 01:06:00 2023 +1000

    extmod/modssl: Add SSLContext class.

    This commit adds the SSLContext class to the ssl module, and retains the
    existing ssl.wrap_socket() function to maintain backwards compatibility.

    CPython deprecated the ssl.wrap_socket() function since CPython 3.7 and
    instead one should use ssl.SSLContext().wrap_socket().  This commit makes
    that possible.

    For the axtls implementation:
    - ssl.SSLContext is added, although it doesn't hold much state because
      axtls requires calling ssl_ctx_new() for each new socket
    - ssl.SSLContext.wrap_socket() is added
    - ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER are added

    For the mbedtls implementation:
    - ssl.SSLContext is added, and holds most of the mbedtls state
    - ssl.verify_mode is added (getter and setter)
    - ssl.SSLContext.wrap_socket() is added
    - ssl.PROTOCOL_TLS_CLIENT and ssl.PROTOCOL_TLS_SERVER are added

    The signatures match CPython:
    - SSLContext(protocol)
    - SSLContext.wrap_socket(sock, *, server_side=False,
        do_handshake_on_connect=True, server_hostname=None)

    The existing ssl.wrap_socket() functions retain their existing signature.

    Signed-off-by: Damien George <[email protected]>

commit c2ea8b2f98c6e2a00f78f9ab14754f53c257302e
Author: Damien George <[email protected]>
Date:   Thu Jun 22 23:22:43 2023 +1000

    renesas-ra: Consolidate all fsp_cfg header files to one location.

    The config header files with the same name have the same contents, so they
    don't need to be repeated for each board in the board's source directory.

    Signed-off-by: Damien George <[email protected]>

commit 23fe170da447340f42e924b2a1fc520a735525bb
Author: Wind-stormger <[email protected]>
Date:   Tue Jun 20 09:28:28 2023 +0000

    esp32/modules/inisetup.py: Format partition as FAT if its label is ffat.

    Signed-off-by: Wind-stormger <[email protected]>

commit 2ede7c6c21133812af8a0891e6a4f3f31c362b50
Author: Damien George <[email protected]>
Date:   Sat Jun 24 18:19:58 2023 +1000

    esp32/boards: Change SDK config parameters from deprecated to new ones.

    Signed-off-by: Damien George <[email protected]>

commit 273ba28c071aec22b67f44775aeec3c5f1a8d5f5
Author: Damien George <[email protected]>
Date:   Fri Jun 23 15:51:23 2023 +1000

    tools/autobuild: Update auto-build code to build esp32 port with IDF v5.

    Signed-off-by: Damien George <[email protected]>

commit 6a9db521eda2f62766749d84244c70fd2073d4a0
Author: Damien George <[email protected]>
Date:   Wed May 17 14:15:10 2023 +1000

    github/workflows: Update esp32 CI to use IDF v5.0.

    Signed-off-by: Damien George <[email protected]>

commit 68e0e889b43c4c381515691b689b5f02f037063f
Author: Damien George <[email protected]>
Date:   Wed Jun 21 11:55:22 2023 +1000

    docs/esp32: Update esp32 docs based on IDF v5 changes.

    Signed-off-by: Damien George <[email protected]>

commit 717060447f7ba7e71a7f40b19c1e977e4e444f12
Author: Damien George <[email protected]>
Date:   Wed Jun 14 12:45:46 2023 +1000

    esp32/Makefile: Provide more IDF shortcuts.

    And change erase_flash to erase-flash, because the former is deprecated
    since IDF 4.4.

    Signed-off-by: Damien George <[email protected]>

commit bccbaa92b1fc6237f0f49a7f07cc194835fbf4e3
Author: Damien George <[email protected]>
Date:   Wed Jun 21 17:08:08 2023 +1000

    esp32/network_wlan: Wait for WIFI_EVENT_STA_START after activating.

    Signed-off-by: Damien George <[email protected]>

commit 2cc3711e5e00c13d43771ee8a78778e7ef3c2930
Author: Glenn Moloney <[email protected]>
Date:   Thu May 25 10:40:50 2023 +1000

    esp32: In recv_cb, get espnow rssi from recv_info->rx_ctrl.

    IDF v5.0 provides access to rssi value for received espnow packets via
    recv_info arg to recv_cb().

    Signed-off-by: Glenn Moloney <[email protected]>

commit e4650125b88a35f074097f16d84a8f49bd22ac06
Author: Damien George <[email protected]>
Date:   Tue May 9 09:52:54 2023 +1000

    esp32: Update port to support IDF v5.0.2.

    This commit updates the esp32 port to work exclusively with ESP-IDF v5.
    IDF v5 is needed for some of the newer ESP32 SoCs to work, and it also
    cleans up a lot of the inconsistencies between existing SoCs (eg S2, S3,
    and C3).

    Support for IDF v4 is dropped because it's a lot of effort to maintain both
    versions at the same time.

    The following components have been verified to work on the various SoCs:

                    ESP32     ESP32-S2  ESP32-S3  ESP32-C3
        build       pass      pass      pass      pass
        SPIRAM      pass      pass      pass      N/A
        REPL (UART) pass      pass      pass      pass
        REPL (USB)  N/A       pass      pass      N/A
        filesystem  pass      pass      pass      pass
        GPIO        pass      pass      pass      pass
        SPI         pass      pass      pass      pass
        I2C         pass      pass      pass      pass
        PWM         pass      pass      pass      pass
        ADC         pass      pass      pass      pass
        WiFi STA    pass      pass      pass      pass
        WiFi AP     pass      pass      pass      pass
        BLE         pass      N/A       pass      pass
        ETH         pass      --        --        --
        PPP         pass      pass      pass      --
        sockets     pass      pass      pass      pass
        SSL         pass      ENOMEM    pass      pass
        RMT         pass      pass      pass      pass
        NeoPixel    pass      pass      pass      pass
        I2S         pass      pass      pass      N/A
        ESPNow      pass      pass      pass      pass
        ULP-FSM     pass      pass      pass      N/A
        SDCard      pass      N/A       N/A       pass
        WDT         pass      pass      pass      pass

    Signed-off-by: Damien George <[email protected]>
    Signed-off-by: Jim Mussared <[email protected]>

commit 2af229c3cc55ceefc4cfba0f50092af725c3bfa9
Author: Damien George <[email protected]>
Date:   Wed Jun 21 17:04:56 2023 +1000

    esp32/modesp32: Remove esp32.hall_sensor function.

    The hall sensor is no longer supported by IDF v5.

    Signed-off-by: Damien George <[email protected]>

commit 1db40ed29542ff85c8d1d1b58707122436b39cf4
Author: Damien George <[email protected]>
Date:   Wed Jun 21 15:09:26 2023 +1000

    esp32/ppp_set_auth: Add pppapi_set_auth from ESP-IDF.

    This function was made private/static in IDF commit
    c67f4c2b4c2bb4b7740f988fc0f8a3e911e56afe, so it add back here.

    Signed-off-by: Damien George <[email protected]>

commit 7c929d4478fbb247c330eb182e9d07440b962cfc
Author: Angus Gratton <[email protected]>
Date:   Tue May 9 15:46:01 2023 +1000

    esp32: Switch from UART driver to UART HAL.

    Allows registering UART interrupt again.

    Signed-off-by: Angus Gratton <[email protected]>

commit 18caf49a7fab84f55fdf170eb5ca1c27206ccc76
Author: Damien George <[email protected]>
Date:   Thu Jun 22 11:18:01 2023 +1000

    extmod/modbtree: Undefine queue macros before including berkeley-db.

    To prevent warnings when building with ESP IDF v5.

    Signed-off-by: Damien George <[email protected]>

commit 402fdc40fb5ca98b3987052cc264e8344d928a69
Author: Damien George <[email protected]>
Date:   Wed Jun 21 14:40:33 2023 +1000

    extmod/modplatform: Set MICROPY_PLATFORM_ARCH on riscv platforms.

    Signed-off-by: Damien George <[email protected]>

commit e7ae3ad92d7540cbe349cc05f5d62e0f63fce59b
Author: Damien George <[email protected]>
Date:   Tue May 9 09:52:16 2023 +1000

    extmod: Update to support mbedtls 3.x.

    Signed-off-by: Damien George <[email protected]>

commit 41c91422f083aaf61036c8ead26bf0c43111ae00
Author: Duncan Lowther <[email protected]>
Date:   Thu Jun 15 09:33:10 2023 +0100

    tests/extmod/framebuf: Fix buffer size issues.

    Tests framebuf1 and framebuf2 do not take the need for byte-aligned
    strides into consideration when calculating buffer lengths.
    Accordingly, the buffers allocated are slightly too small. Fixed
    buffer length calculations.

    Signed-off-by: Duncan Lowther <[email protected]>

commit bc2ed8c55a69d80ea6aa8441673232a8c4054f13
Author: Duncan Lowther <[email protected]>
Date:   Wed Jun 14 15:29:39 2023 +0100

    tests/extmod/uctypes_array_assign_le: Fix buffer.

    Structure descriptor in test extmod/uctypes_array_assign_le
    is 6 bytes long, due to member "arr3" having length 4
    (2 * UINT16) and offset 2, but only 5 bytes are allocated.
    Increased buffer length to 6 bytes.

    Signed-off-by: Duncan Lowther <[email protected]>

commit ae778363702a759e987bb9209165f5a413dbd8a9
Author: Duncan Lowther <[email protected]>
Date:   Wed Jun 14 15:03:14 2023 +0100

    extmod/modbinascii: Fix buffer length error.

    The mod_binascii_a2b_base64() function allocates a buffer which may be
    too small. It needs to be no less than three-quarters of the input
    length, but is calculated as (<length> / 4) * 3 + 1, which may be less
    due to integer division. Changed to (<length> * 3) / 4 + 1.

    Signed-off-by: Duncan Lowther <[email protected]>

commit 25fb6515663f7541704d15068de280702e428042
Author: Duncan Lowther <[email protected]>
Date:   Thu Jun 8 16:22:17 2023 +0100

    lib/oofatfs: Fix speculative read in create_name.

    Signed-off-by: Duncan Lowther <[email protected]>

commit ca79b4961953be587a290bc995ae925e664c9fbc
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 16:42:19 2023 +1000

    extmod/asyncio/uasyncio.py: Add backwards-compatible uasyncio alias.

    This allows existing code that does `import uasyncio` or
    `import uasyncio as asyncio` to continue working.

    It uses the same lazy-loading as asyncio to prevent loading of unused
    features.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 7979a4d26776330a89166fa60c917475579f7dd8
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 16:14:54 2023 +1000

    ports: In machine_i2s.c, rename uasyncio to asyncio.

    Mostly updates comments, but also renames the UASYNCIO enum value to
    ASYNCIO.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit d975bb1f2799a3a0b33ee073886354ca03e2e7f5
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 16:11:49 2023 +1000

    examples/hwapi: Rename uasyncio to asyncio.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 9092909bf5e5f3347a93ea5146dd93320527956a
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 16:08:09 2023 +1000

    docs: Rename uasyncio to asyncio.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 6027c41c8f5b8f1a9e7b85b2bb93b3e6f2718e54
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 16:01:38 2023 +1000

    tests: Rename uasyncio to asyncio.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 2fbc08c462e247e7f78460783c9a07c76c5b762e
Author: Jim Mussared <[email protected]>
Date:   Thu Jun 8 15:51:50 2023 +1000

    extmod/asyncio: Rename uasyncio to asyncio.

    The asyncio module now has much better CPython compatibility and
    deserves to be just called "asyncio".

    This will avoid people having to write `from uasyncio import asyncio`.

    Renames all files, and updates port manifests to use the new path. Also
    renames the built-in _uasyncio to _asyncio.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit ed962f1f233eb74edf2cee83dc488d3cac5e02ee
Author: Damien George <[email protected]>
Date:   Fri Jun 16 12:08:34 2023 +1000

    tests/float: Test domain errors for more combos of args to math funcs.

    Instead of having a special set of arguments to test for each math-module
    function, just test all functions with all sets of arguments.  This gives
    improved test cases to prevent regressions.

    Signed-off-by: Damien George <[email protected]>

commit 47dc7d0130d583ce3c9426a82eabe0473ec1cfa5
Author: Damien George <[email protected]>
Date:   Thu Jun 15 12:19:57 2023 +1000

    esp32,esp8266: Allow Ctrl-C to interrupt the corrupt-fs while loop.

    Commit c046b23ea29e0183c899a8dbe1da3bed3440a255 prevented frozen boot code
    from being interrupted by Ctrl-C, but that means a corrupt filesystem will
    forever lock up an esp32/esp8266 board.  This commit fixes that by
    explicitly enabling Ctrl-C before running the forever loop.

    Signed-off-by: Damien George <[email protected]>

commit 0908d00453e63560451edfd062a0d24face1c705
Author: Damien George <[email protected]>
Date:   Wed Jun 14 14:43:35 2023 +1000

    tools/ci.sh: Add a H5 board to stm32 CI build.

    Signed-off-by: Damien George <[email protected]>

commit 6f74146bc14fcc4011ec8df497fd85d52f176e4e
Author: Damien George <[email protected]>
Date:   Wed Mar 22 16:41:11 2023 +1100

    stm32/boards/STM32H573I_DK: Add H5 board definition files.

    Signed-off-by: Damien George <[email protected]>

commit 56a22ddc8b610235d4bfca08a56a57451feef22f
Author: Damien George <[email protected]>
Date:   Wed May 24 12:45:14 2023 +1000

    stm32/octospi: Add preliminary support for OCTOSPI peripheral.

    It currently operates in 1-line (SPI) mode only.

    Signed-off-by: Damien George <[email protected]>

commit ec4232b32e5d24ae363786ac10305272447ed303
Author: Damien George <[email protected]>
Date:   Wed Mar 22 16:39:12 2023 +1100

    stm32/boards: Add ld, af.csv and hal_conf_base.h files for H5 MCUs.

    Signed-off-by: Damien George <[email protected]>

commit 61339aa5062577ca1c75cb2443c78e5b5965c30b
Author: Damien George <[email protected]>
Date:   Wed Mar 22 16:38:49 2023 +1100

    stm32: Add initial support for H5 MCUs.

    This commit adds initial support for STM32H5xx MCUs.  The following
    features have been confirmed to be working on an STM32H573:
    - UART over REPL and USB CDC
    - USB CDC and MSC
    - internal flash filesystem
    - machine.Pin
    - machine.SPI transfers with DMA
    - machine.ADC
    - machine.RTC
    - pyb.LED
    - pyb.Switch
    - pyb.rng
    - mboot

    Signed-off-by: Damien George <[email protected]>

commit bd7196e1233a7c36fbd8be8fea71eaaad4fb62fa
Author: Damien George <[email protected]>
Date:   Wed Jun 14 15:13:47 2023 +1000

    lib/stm32lib: Update library for H5 v1.0.0.

    Changes in this new library version are:
    - Add H5 HAL at v1.0.0.

    Signed-off-by: Damien George <[email protected]>

commit f7f8332ddf877c15f89c525fbfb34f5ff9f8f453
Author: Damien George <[email protected]>
Date:   Thu Jun 15 10:58:53 2023 +1000

    stm32/machine_adc: Handle ADC resolution less than 8 bits on all MCUs.

    All MCUs can have 6-bit resolution; see adc_cr_to_bits_table.

    Signed-off-by: Damien George <[email protected]>

commit 92d2de82e29fb27d329417a76f0dc95b5b29e9b1
Author: Damien George <[email protected]>
Date:   Wed Jun 14 17:10:22 2023 +1000

    stm32/usbd_conf: Treat G0 USB periph as MICROPY_HW_USB_IS_MULTI_OTG=0.

    The G0 USB peripheral behaves more like MICROPY_HW_USB_IS_MULTI_OTG=0 than
    that config =1.  This fixes the configuration of the PMA FIFO buffers.

    Signed-off-by: Damien George <[email protected]>

commit b839acc7d9231df049793bd32c672f72b705af3e
Author: Damien George <[email protected]>
Date:   Wed May 24 15:55:28 2023 +1000

    stm32/main: Start UART REPL as early as possible.

    For debugging purposes, to see output from other peripherals.

    Also reset the pyb_stdio_uart state at the end of soft reset, in case it
    points to a heap-allocated object.

    Signed-off-by: Damien George <[email protected]>

commit fb1bdf0ff2d48fbc28ce89b5424fac07edd50e4b
Author: Damien George <[email protected]>
Date:   Wed Mar 22 16:27:05 2023 +1100

    stm32/make-stmconst.py: Support structs with names ending in _t.

    Signed-off-by: Damien George <[email protected]>

commit 68b09abc45ddd4077dfecf215624d7a4e1915ce3
Author: Damien George <[email protected]>
Date:   Thu Mar 2 00:15:02 2023 +1100

    stm32/Makefile: Pass relevant CPU flags to assembler.

    Needed for compiling gchelper_thumb2 on cortex-m33.

    Signed-off-by: Damien George <[email protected]>

commit bf9ca0bb33a715e09387009987f3f2d3332bb75f
Author: Damien George <[email protected]>
Date:   Thu Mar 2 00:14:43 2023 +1100

    py/mkrules.mk: Allow $(AFLAGS) to set flags to $(AS).

    Signed-off-by: Damien George <[email protected]>

commit 33b403dfb4ea9ec90427e7228c53e0ac4d333863
Author: Damien George <[email protected]>
Date:   Tue Jun 13 09:36:26 2023 +1000

    tools/ci.sh: Build PICO_W board as part of rp2 CI.

    Signed-off-by: Damien George <[email protected]>

commit 856e08b1931b88271816a2f60648f6ff332235b2
Author: Peter Harper <[email protected]>
Date:   Mon Mar 13 10:40:22 2023 +0000

    rp2/boards/PICO_W: Enable Bluetooth Low Energy support.

    Signed-off-by: Damien George <[email protected]>

commit ba83f6d50c0da30e159d266232457d8c1d281179
Author: Peter Harper <[email protected]>
Date:   Mon Mar 13 10:39:06 2023 +0000

    extmod/btstack: Fix marking of static addresses in set_random_address.

    Marking address as static was not applied to all code paths.

    Signed-off-by: Damien George <[email protected]>

commit a459eaf3e6a8d0e0f36c885c994819a296a64e71
Author: Peter Harper <[email protected]>
Date:   Mon Mar 13 10:35:48 2023 +0000

    rp2/mpbthciport: Cancel existing alarms.

    Cancel any existing poll alarm before add a new one.

    Signed-off-by: Damien George <[email protected]>

commit 888a15cda3c7094009563fc65f19c6d8f76cc201
Author: Peter Harper <[email protected]>
Date:   Wed Jul 13 13:08:09 2022 +0100

    rp2: Add Bluetooth support via cyw43.

    Using BTstack with CYW43 for Pico W.

    Signed-off-by: Damien George <[email protected]>

commit 35182a86884f23d8bbee212506abb785920be055
Author: Peter Harper <[email protected]>
Date:   Tue Aug 2 17:34:30 2022 +0100

    extmod/btstack: Add cmake support for BTstack.

    Signed-off-by: Damien George <[email protected]>

commit 1de335f7ff0758ebdda5bd6abea3ea45a9c29c5e
Author: Damien George <[email protected]>
Date:   Tue Jun 13 00:04:43 2023 +1000

    lib/pico-sdk: Update to version 1.5.1.

    Signed-off-by: Damien George <[email protected]>

commit 825a95713ed30e8a4dc542088d88ac24fa8a9cee
Author: Damien George <[email protected]>
Date:   Tue Jun 13 00:04:24 2023 +1000

    lib/btstack: Update to v1.5.6.2.

    Signed-off-by: Damien George <[email protected]>

commit ca3807081aa80646e5e4cb44b1457ae3ad35f1b5
Author: Damien George <[email protected]>
Date:   Tue Jun 13 00:04:02 2023 +1000

    lib/cyw43-driver: Update driver to latest version v1.0.1.

    Includes a fix for combined BT+WiFi when using SPI transport.

    Signed-off-by: Damien George <[email protected]>

commit b3cd41dd4ba9d44910b7efc6c4a1fa5f531858d4
Author: Jared Hancock <[email protected]>
Date:   Mon May 30 10:22:57 2022 -0400

    py/lexer: Allow conversion specifiers in f-strings (e.g. !r).

    PEP-498 allows for conversion specifiers like !r and !s to convert the
    expression declared in braces to be passed through repr() and str()
    respectively.

    This updates the logic that detects the end of the expression to also stop
    when it sees "![rs]" that is either at the end of the f-string or before
    the ":" indicating the start of the format specifier. The "![rs]" is now
    retained in the format string, whereas previously it stayed on the end
    of the expression leading to a syntax error.

    Previously: `f"{x!y:z}"` --> `"{:z}".format(x!y)`
    Now: `f"{x!y:z}"` --> `"{!y:z}".format(x)`

    Note that "!a" is not supported by `str.format` as MicroPython has no
    `ascii()`, but now this will raise the correct error.

    Updated cpydiff and added tests.

    Signed-off-by: Jim Mussared <[email protected]>

commit 5ce1a03a78bf87c914d53f63a35cf2b81963e6e4
Author: Damien George <[email protected]>
Date:   Mon Jun 12 13:09:48 2023 +1000

    py/makemoduledefs.py: Automatically declare delegation attr functions.

    So that the delegation functions don't need to be put somewhere global,
    like in mpconfigport.h.  That would otherwise make it hard for extension
    modules to use delegation.

    Signed-off-by: Damien George <[email protected]>

commit 44295c9daa8a9210e2855ef431de21362c0cb662
Author: Damien George <[email protected]>
Date:   Mon Jun 12 13:09:29 2023 +1000

    py/makemoduledefs.py: Fix declaring multiple module delegations.

    Signed-off-by: Damien George <[email protected]>

commit b02a5fa10aba1b17c9a24a073992ded8d7031a69
Author: David Lechner <[email protected]>
Date:   Sun Jun 11 14:53:15 2023 -0500

    py/nlraarch64: Fix dangerous use of input register.

    Starting with 2757acf6, the `top` variable in `nlr_jump()` in
    `nlraarch64.c` was assigned to register `x19` by the compiler.  However,
    the assembly code writes over that register with

        ldp x19, x20, [%0,  #32]

    since `%0` is now `x19`. This causes the next line

        ldp lr,  x9,  [%0,  #16]

    to load the wrong values.

    To fix the issue, we move the value of the `top` variable from an unknown
    register to a known register at the beginning of the asm code then only use
    known/hard-coded registers after that.

    Fixes issue #11754.

    Signed-off-by: David Lechner <[email protected]>

commit 8cf9898dd3c93f3226d009ebce30f1f1c97b7afb
Author: David Lechner <[email protected]>
Date:   Tue Jun 6 10:41:23 2023 -0500

    py/parsenum: Fix typo in #endif comment.

    This fixes a `#endif` comment to exactly match the `#if`.

    Signed-off-by: David Lechner <[email protected]>

commit 034502bc72e8d1b6371ce2970fdba4b7f4f41710
Author: Wilko Nienhaus <[email protected]>
Date:   Sun Jun 4 15:42:13 2023 +0300

    esp32/esp32_ulp: Fix ULP (FSM) support for S2 and S3.

    This change enables the ULP (FSM) for all ESP32 variants rather than
    requiring it to be enabled for each board specifically.

    It also ensures the correct header file is included for each variant.

    Lastly, it updates the IDF version we're builing against to v4.4.2, as that
    version contains important fixes to make the ULP actually work on S2/S3
    chips. See: https://github.com/espressif/esp-idf/commit/a0e3d48

    Signed-off-by: Wilko Nienhaus <[email protected]>

commit ea8f0fd8965f24e5c9978a4078e377d2a0480908
Author: Brian 'redbeard' Harrington <[email protected]>
Date:   Mon Jun 12 13:15:56 2023 -0700

    rp2/CMake: Normalize MICROPY_PORT_DIR.

    In 5fe2a3f1 the ESP32 port underwent a change to how `MICROPY_PORT_DIR`
    is defined.  This commit normalizes the `rp2` port to use the same
    underlying variable mechanism (`CMAKE_CURRENT_LIST_DIR`).

    Signed-off-by: Brian 'redbeard' Harrington <[email protected]>

commit 5fe2a3f14f8f60a536c5db12826ef2c3a8921951
Author: Brian 'redbeard' Harrington <[email protected]>
Date:   Mon Jun 12 13:02:10 2023 -0700

    esp32/CMake: Change PROJECT_DIR to CMAKE_CURRENT_LIST_DIR.

    This migrates the CMake variable `MICROPY_PORT_DIR` from the ESP-IDF
    defined project to the component. Previously used instances of the variable
    within the project definition have been migrated to
    `CMAKE_CURRENT_LIST_DIR`. Within the component (the `main` subdirectory in
    the ESP32 port) we define `MICROPY_PORT_DIR` using `CMAKE_CURRENT_LIST_DIR`
    and subsequently use the `MICROPY_PORT_DIR` value in all locations where
    `PROJECT` had previously been used.

    Context:

    In commit 9b90882146, initial support was added for building with the newly
    introduced CMake support provided by the ESP-IDF.

    Specifically, the commit message states:

    > This commit adds support for building the esp32 port with CMake, and in
    particular, it builds MicroPython as a component within the ESP-IDF. Using
    CMake and the ESP-IDF build infrastructure makes it much easier to maintain
    the port, especially with the various new ESP32 MCUs and their required
    toolchains.

    `PROJECT_DIR` is a variable populated by the ESP-IDF specifically and is
    not stable when used with "[Pure CMake components][1]" as documented in the
    ESP-IDF. It is intended to be used in the scope of the parent of the
    current file (the "project") as opposed to the current file ("the
    component"). Crossing into the parent scope like this works solely when the
    "project" is MicroPython, but not when used as a component by other ESP-IDF
    projects.

    Analyzing this file, the intention is to reference the "Project" which in
    the example is the parent directory. Within the [CMake variables][2]
    documentation, there is one specifically defined for referencing the
    directory for the CMake listfile currently being processed:
    [`CMAKE_CURRENT_LIST_DIR`][3].

    After making the change from `PROJECT_DIR` to `CMAKE_CURRENT_LIST_DIR`, the
    reach into the parent scope defined by the ESP-IDF and the resulting CMake
    interface violation is removed.

    Similar to the component definition, the project `CMakeLists.txt` uses the
    variable `CMAKE_SOURCE_DIR` which CMake defines as "The path to the top
    level of the source tree."  This commit changes the variable to
    `CMAKE_CURRENT_LIST_DIR` for the reasons cited above.

    [1]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/build-system.html#writing-pure-cmake-components
    [2]: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
    [3]: https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_LIST_DIR.html

    Signed-off-by: Brian 'redbeard' Harrington <[email protected]>

commit fd277704c458784a0e25ae87cf7190833661185d
Author: Glenn Moloney <[email protected]>
Date:   Fri Jun 9 13:09:46 2023 +1000

    esp32/modespnow: Change name of buffer size config option to "rxbuf".

    Rename "buffer" option to "rxbuf" which accords with docs and esp8266.

    Signed-off-by: Glenn Moloney <[email protected]>

commit b4de697ad10427a1513c02160abd0662f55701d5
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 9 13:34:08 2023 +1000

    tools/mpremote: Fix exec_ -> exec in commands.py.

    This was missed in the pyboard refactor and is preventing `cp -r` from
    working.

    Signed-off-by: Jim Mussared <[email protected]>

commit f01d5fb657159f1afa9d41cf39830d17b791a67e
Author: Damien George <[email protected]>
Date:   Tue Jun 6 14:24:41 2023 +1000

    py/mkrules.mk: Automatically configure frozen options when manifest set.

    Following how mkrules.cmake works.  This makes it easy for a port to enable
    frozen code, by defining FROZEN_MANIFEST in its Makefile.

    Signed-off-by: Damien George <[email protected]>

commit 30100e9b3d4e2b805997a642e5e411aaf14324a7
Author: Damien George <[email protected]>
Date:   Wed May 24 16:18:08 2023 +1000

    stm32/boards: Use default spibdev config where appropriate.

    Signed-off-by: Damien George <[email protected]>

commit 3b370157d007649d5d5ed1747514ea242f597215
Author: Damien George <[email protected]>
Date:   Wed May 24 16:17:58 2023 +1000

    stm32/mpconfigboard_common: Provide default spidev config.

    Signed-off-by: Damien George <[email protected]>

commit 0832fc53cec2d3fd5ed8c9108d185f00b83c3a8f
Author: Damien George <[email protected]>
Date:   Tue Jun 6 14:10:38 2023 +1000

    tools/ci.sh: Add mimxrt and samd ports to code size build.

    The automatic code size build and GitHub comment is a really useful
    feature.  This commit adds a few more builds to it (mimxrt and samd).

    Signed-off-by: Damien George <[email protected]>

commit a1fbb1980cf90cc58186eac9cc405a97ebd41e64
Author: Jim Mussared <[email protected]>
Date:   Tue Jun 6 22:15:44 2023 +1000

    extmod/modtimeq: Remove timeq module.

    This is a MicroPython-specific module that existed to support the old
    version of uasyncio.  It's undocumented and not enabled on all ports and
    takes up code size unnecessarily.

    Signed-off-by: Jim Mussared <[email protected]>

commit 8211d56712301d58970904892da5312b11b2ab7c
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 23:33:42 2023 +1000

    docs/library/index: Update docs after umodule rename.

    - Update guide for extending built-in modules.
    - Remove any last trace of umodule in other docs.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 5fd042e7d1610b4d42acfc523441468f2ac28c6f
Author: Jim Mussared <[email protected]>
Date:   Fri Aug 19 22:58:37 2022 +1000

    all: Replace all uses of umodule in Python code.

    Applies to drivers/examples/extmod/port-modules/tools.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 9d7eac07138b6e02f4c0775dc70f36fdd69432a2
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 17:58:27 2023 +1000

    tests/run-natmodtests.py: Don't allow imports from the cwd.

    Make tests run in an isolated environment (i.e. `import io` would
    otherwise get the `tests/io` directory).

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 339f02a5947e79347014b4d34adbf8a120b184bc
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 15:40:03 2023 +1000

    tests/run-perfbench.py: Don't allow imports from the cwd.

    Make tests run in an isolated environment (i.e. `import io` would
    otherwise get the `tests/io` directory).

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 109717457edbf49421af3848ea26e26fff567289
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 15:23:23 2023 +1000

    tests/run-multitests.py: Don't allow imports from the cwd.

    Make tests run in an isolated environment (i.e. `import io` would
    otherwise get the `tests/io` directory).

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 4216bc7d1351feb8199e4ebbff1a9598aa1c5b02
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 16:57:45 2022 +1000

    tests: Replace umodule with module everywhere.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 5e50975a6dd9466afafbcd012c00078093fe1f57
Author: Jim Mussared <[email protected]>
Date:   Mon Jun 5 16:52:29 2023 +1000

    py/modsys: Allow sys.path to be assigned to.

    Previously sys.path could be modified by append/pop or slice assignment.

    This allows `sys.path = [...]`, which can be simpler in many cases, but
    also improves CPython compatibility.

    It also allows sys.path to be set to a tuple which means that you can
    clear sys.path (e.g. temporarily) with no allocations.

    This also makes sys.path (and sys.argv for consistency) able to be disabled
    via mpconfig. The unix port (and upytesthelper) require them, so they
    explicitly verify that they're enabled.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 7d2ee8aed0cc5ba1a0041ac4cc7631898aaf252f
Author: Jim Mussared <[email protected]>
Date:   Mon Jun 5 22:38:36 2023 +1000

    py/mpconfig: Enable module delegation if sys needs it.

    Otherwise you can get into the confusing state where e.g. sys.ps1 is
    enabled in config (via `MICROPY_PY_SYS_PS1_PS2`) but still doesn't actually
    get enabled.

    Also verify that the required delegation options are enabled in modsys.c.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit e6926d60219d9b00da3eedb5eedecefe0d6c321c
Author: Jim Mussared <[email protected]>
Date:   Tue Jun 6 22:49:50 2023 +1000

    py/objmodule: Workaround for MSVC with no module delegation.

    When compiling mpy-cross, there is no `sys` module, and so there will
    be no entries in the `mp_builtin_module_delegation_table`.

    MSVC doesn't like this, so instead pretend as if the feature isn't
    enabled at all.

    Signed-off-by: Jim Mussared <[email protected]>

commit 13c817e61cf2f00fc398e01840e5d8c20e575c8c
Author: Jim Mussared <[email protected]>
Date:   Mon Jun 5 15:52:57 2023 +1000

    py/objmodule: Add a table of built-in modules with delegation.

    This replaces the previous QSTR_null entry in the globals dict which could
    leak out to Python (e.g. via iteration of mod.__dict__) and could lead to
    crashes.

    It results in smaller code size at the expense of turning a lookup into a
    loop, but the list it is looping over likely only contains one or two
    elements.

    To allow a module to register its custom attr function it can use the new
    `MP_REGISTER_MODULE_DELEGATION` macro.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit eb85f4d4c9c332c8e7bef9b20bb06e25f6f6c5d2
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 21:40:53 2022 +1000

    examples/natmod: Rename umodule to module.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 2eba98f1e0d292de0f7e48ce228221ef50c01967
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 12:33:25 2023 +1000

    all: Use MP_REGISTER_EXTENSIBLE_MODULE for overrideable built-ins.

    Signed-off-by: Jim Mussared <[email protected]>

commit 24c02c4eb5f11200f876bb57cd63a9d0bae91fd3
Author: Jim Mussared <[email protected]>
Date:   Fri Jun 2 12:28:07 2023 +1000

    py/makemoduledefs.py: Add a way to register extensible built-in modules.

    Signed-off-by: Jim Mussared <[email protected]>

commit 45ac651d1a2801bccbdc32fddaa9b029ed4ce879
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 16:24:27 2022 +1000

    all: Rename *umodule*.c to remove the "u" prefix.

    Updates any includes, and references from Makefiles/CMake.

    This essentially reverts what was done long ago in commit
    136b5cbd7669e8318f8455fc2706da97a5b7994c

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 0ceccd4cf809ef067feea8c42614b1bd07984451
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 15:07:24 2022 +1000

    all: Rename *umodule*.h to remove the "u" prefix.

    This work was funded through GitHub Sponsors.

    Also updates #includes.

    Signed-off-by: Jim Mussared <[email protected]>

commit f5f9edf6457624bf32e71b0c2fdcfbfa5d5753a6
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 15:01:26 2022 +1000

    all: Rename UMODULE to MODULE in preprocessor/Makefile vars.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 7f5d5c72718af773db751269c6ae14037b9c0727
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 14:49:57 2022 +1000

    all: Rename mod_umodule*, ^umodule* to remove the "u" prefix.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 1bf2dcb15ecf4ba37211327f4378b164a5aaf567
Author: Jim Mussared <[email protected]>
Date:   Thu Aug 18 14:47:56 2022 +1000

    all: Rename mp_umodule*, mp_module_umodule* to remove the "u" prefix.

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit dfe232d0003b9f381643050c06c547fc3093e9e1
Author: Jim Mussared <[email protected]>
Date:   Wed Aug 17 16:21:03 2022 +1000

    py/builtinimport: Remove weak links.

    In order to keep "import umodule" working, the existing mechanism is
    replaced with a simple fallback to drop the "u".

    This makes importing of built-ins no longer touch the filesystem, which
    makes a typical built-in import take ~0.15ms rather than 3-5ms.

    (Weak links were added in c14a81662c1df812c0c6b4299f97966302f16477)

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit 30628d1bb782006c88325a086ddfcd5c2e5ddbb4
Author: Jim Mussared <[email protected]>
Date:   Wed Aug 17 16:18:31 2022 +1000

    all: Rename MP_QSTR_umodule to MP_QSTR_module everywhere.

    This renames the builtin-modules, such that help('modules') and printing
    the module object will show "module" rather than "umodule".

    This work was funded through GitHub Sponsors.

    Signed-off-by: Jim Mussared <[email protected]>

commit d080d427ebcc263ac6ff792271cec1506e5c81fc
Author: Yaroslav Halchenko <[email protected]>
Date:   Fri Jun 2 13:21:39 2023 -0400

    top: Add "mis" to list of ignore words for codespell.

    Observed with codespell 2.2.5.dev57+gdc7e98d9:

        $ codespell
        ./ports/rp2/machine_uart.c:163: mis ==> miss, mist
        ./ports/rp2/machine_uart.c:168: mis ==> miss, mist
        2

commit db5444f68aaca1bec2c90df0ed5afe36bce94cfc
Author: robert-hh <[email protected]>
Date:   Wed May 24 16:21:35 2023 +0200

    samd/boards: Extend the code size limit for boards with external flash.

    Code size limits are charged to:
    - SAMD21:    184K -> 248K
    - SAMD51x19: 368K -> 496K
    - SAMD51x20: 368K -> 1008K

    Signed-off-by: robert-hh <[email protected]>

commit 69cb5e8f2ac6ffd1b4e2127eb31321bff240a654
Author: robert-hh <[email protected]>
Date:   Wed May 24 16:19:33 2023 +0200

    samd: Adapt existing samd.Flash and integrate with (Q)SPI flash in boot.

    Checks are added to ensure, that only one of the flash drivers is selected.

    Signed-off-by: robert-hh <[email protected]>

commit 2b5a5a0f35b325e14268f8f48ac8b5022da87691
Author: robert-hh <[email protected]>
Date:   Wed May 24 16:16:40 2023 +0200

    samd/samd_qspiflash: Add QSPI flash driver and configure it accordingly.

    The QSPI driver provides the interface for using an on-board QSPI flash for
    the filesystem.  It provides the same methods as the driver for the
    internal flash and uses the same name.  Therefore, only one of the drivers
    for internal flash, SPI flash and QSPI flash must be enabled at a time.

    Signed-off-by: robert-hh <[email protected]>

commit 5561130c3f220e52fc878b683fc90ecb031427e6
Author: robert-hh <[email protected]>
Date:   Wed May 24 16:14:47 2023 +0200

    samd/samd_spiflash: Add SPI flash driver and configure it accordingly.

    The SPI flash driver includes the block device for being used as a
    filesystem.  It provides the same methods as the driver for the internal
    flash.

    Signed-off-by: robert-hh <[email protected]>

commit bf7d3ad8c69431d7bb8d1188484996af94e78990
Author: robert-hh <[email protected]>
Date:   Wed May 24 16:13:01 2023 +0200

    samd/boards: Rename flash pins consistently for QSPI and SPI.

    For SAMD21 devices, the board flash signals must be named in pins.csv as
    FLASH_MOSI, FLASH_MISO, FLASH_SCK, FLASH_CS for creating the SPI object.

    And rename the QSPI pins to QSPI_xxxx instead of FLASH_xxx.

    Signed-off-by: robert-hh <[email protected]>

commit a79a6ab3641e3536e509278706e7ac4de01a8126
Author: David Grayson <[email protected]>
Date:   Sun Jun 4 19:55:41 2023 -0700

    py/builtinimport: Remove partially-loaded modules from sys.modules.

    Prior to this commit, importing a module that exists but has a syntax error
    or some other problem that happens at import time would result in a
    potentially-incomplete module object getting added to sys.modules.
    Subsequent imports would use that object, resulting in confusing error
    messages that hide the root cause of the problem.

    This commit fixes that issue by removing the failed module from sys.modules
    using the new NLR callback mechanism.

    Note that it is still important to add the module to sys.modules while the
    import is happening so that we can support circular imports just like
    CPython does.

    Fixes issue #967.

    Signed-off-by: David Grayson <[email protected]>

commit ce31e5a2dc0736ebc7976098f1fdf520b2c32892
Author: Damien George <[email protected]>
Date:   Tue May 9 11:03:17 2023 +1000

    py: Use nlr jump callbacks to optimise compile/execute functions.

    The changed functions now use less stack, and don't have any issues with
    local variables needing to be declared volatile.

    Testing on a PYBv1.0, imports (of .py, .mpy and frozen code) now use 64
    less bytes of C stack per import depth.

    Signed-off-by: Damien George <[email protected]>

commit 2757acf6ed1fe165e4d8aa72ba8090fb9bc60c31
Author: Damien George <[email protected]>
Date:   Tue May 9 11:03:04 2023 +1000

    py/nlr: Implement jump callbacks.

    NLR buffers are usually quite large (use lots of C stack) and expensive to
    push and pop.  Some of the time they are only needed to perform clean up if
    an exception happens, and then they re-raise the exception.

    This commit allows optimizing that scenario by introducing a linked-list of
    NLR callbacks that are called automatically when an exception is raised.
    They are essentially a light-weight NLR handler that can implement a
    "finally" block, i.e. clean-up when an exception is raised, or (by passing
    `true` to nlr_pop_jump_callback) when execution leaves the scope.

    Signed-off-by: Damien George <[email protected]>

commit f36ae5edcb5556c35b2dfe10be7ba54a21da0c9b
Author: Damien George <[email protected]>
Date:   Fri Jun 2 17:52:40 2023 +1000

    py/nlr: Remove commented-out debugging code.

    Also re…
  • Loading branch information
IhorNehrutsa committed Jul 21, 2023
1 parent 631968a commit 78a55ca
Show file tree
Hide file tree
Showing 2,704 changed files with 84,273 additions and 71,168 deletions.
8 changes: 7 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#all: Reformat remaining C code that doesn't have a space after a comma.
# all: Fix spelling mistakes based on codespell check.
b1229efbd1509654dec6053865ab828d769e29db

# top: Update Python formatting to black "2023 stable style".
8b2748269244304854b3462cb8902952b4dcb892

# all: Reformat remaining C code that doesn't have a space after a comma.
5b700b0af90591d6b1a2c087bb8de6b7f1bfdd2d

# ports: Reformat more C and Python source code.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please see the MicroPython Forum (https://forum.micropython.org/) or raise a documentation request instead.
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab or raise a documentation request instead.

* In your issue, please include a clear and concise description of what the bug is, the expected output, and how to replicate it.

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: MicroPython Forum
url: https://forum.micropython.org/
- name: MicroPython GitHub Discussions
url: https://github.com/orgs/micropython/discussions
about: Community discussion about all things MicroPython. This is the best place to start if you have questions about using MicroPython or getting started with MicroPython development.
- name: MicroPython Documentation
url: https://docs.micropython.org/
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please see the MicroPython Forum -- https://forum.micropython.org/
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab instead.

* Describe what was missing from the documentation and/or what was incorrect/incomplete.

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please see the MicroPython Forum (https://forum.micropython.org/) or raise a documentation request instead.
* Please search existing issues before raising a new issue. For questions about MicroPython or for help using MicroPython, or any sort of "how do I?" requests, please use the Discussions tab or raise a documentation request instead.

* Describe the feature you'd like to see added to MicroPython. In particular, what does this feature enable and why is it useful. MicroPython aims to strike a balance between functionality and code size, so please consider whether this feature can be optionally enabled and whether it can be provided in other ways (e.g. pure-Python library).

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/security.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Security report
about: Report a security issue or vunerability in MicroPython
about: Report a security issue or vulnerability in MicroPython
title: ''
labels: security
assignees: ''
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
20 changes: 17 additions & 3 deletions .github/workflows/code_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@ name: Check code formatting

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
code-formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install packages
run: source tools/ci.sh && ci_code_formatting_setup
- name: Run code formatting
run: source tools/ci.sh && ci_code_formatting_run
- name: Check code formatting
run: git diff --exit-code

code-spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install packages
run: source tools/ci.sh && ci_code_spell_setup
- name: Run spell checker
run: source tools/ci.sh && ci_code_spell_run
22 changes: 20 additions & 2 deletions .github/workflows/code_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,34 @@ on:
- 'ports/bare-arm/**'
- 'ports/minimal/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Install packages
run: source tools/ci.sh && ci_code_size_setup
- name: Build
run: source tools/ci.sh && ci_code_size_build
- name: Compute code size difference
run: tools/metrics.py diff --error-threshold 0 ~/size0 ~/size1
run: tools/metrics.py diff ~/size0 ~/size1 | tee diff
- name: Save PR number
if: github.event_name == 'pull_request'
env:
PR_NUMBER: ${{ github.event.number }}
run: echo $PR_NUMBER > pr_number
- name: Upload diff
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: code-size-report
path: |
diff
pr_number
retention-days: 1
105 changes: 105 additions & 0 deletions .github/workflows/code_size_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Code size comment

on:
workflow_run:
workflows: [Check code size]
types: [completed]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
comment:
runs-on: ubuntu-20.04
steps:
- name: 'Download artifact'
id: download-artifact
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const fs = require('fs');
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "code-size-report"
});
if (matchArtifact.length === 0) {
console.log('no matching artifact found');
console.log('result: "skip"');
return 'skip';
}
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact[0].id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/code-size-report.zip`, Buffer.from(download.data));
console.log('artifact downloaded to `code-size-report.zip`');
console.log('result: "ok"');
return 'ok';
- name: 'Unzip artifact'
if: steps.download-artifact.outputs.result == 'ok'
run: unzip code-size-report.zip
- name: Post comment to pull request
if: steps.download-artifact.outputs.result == 'ok'
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const prNumber = Number(fs.readFileSync('pr_number'));
const codeSizeReport = `Code size report:
\`\`\`
${fs.readFileSync('diff')}
\`\`\`
`;
const comments = await github.paginate(
github.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
}
);
comments.reverse();
const previousComment = comments.find(comment =>
comment.user.login === 'github-actions[bot]'
)
// if github-actions[bot] already made a comment, update it,
// otherwise create a new comment.
if (previousComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: previousComment.id,
body: codeSizeReport,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: codeSizeReport,
});
}
8 changes: 6 additions & 2 deletions .github/workflows/commit_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Check commit message formatting

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: '100'
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
- name: Check commit message formatting
run: source tools/ci.sh && ci_commit_formatting_run
8 changes: 6 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ on:
paths:
- docs/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install Python packages
run: pip install Sphinx
- name: Build docs
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ on:
- 'py/**'
- 'shared/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
embedding:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
run: make -C examples/embedding
run: make -C examples/embedding -f micropython_embed.mk && make -C examples/embedding
- name: Run
run: test "$(./examples/embedding/hello-embed)" = "Hello world of easy embedding!"
run: ./examples/embedding/embed | grep "hello world"
29 changes: 29 additions & 0 deletions .github/workflows/mpremote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Package mpremote

on:
push:
pull_request:
paths:
- '.github/workflows/*.yml'
- 'tools/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Setting this to zero means fetch all history and tags,
# which hatch-vcs can use to discover the version tag.
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Install build tools
run: pip install build
- name: Build mpremote wheel
run: cd tools/mpremote && python -m build --wheel
- name: Archive mpremote wheel
uses: actions/upload-artifact@v3
with:
name: mpremote
path: |
tools/mpremote/dist/mpremote*.whl
10 changes: 8 additions & 2 deletions .github/workflows/mpy_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ on:
pull_request:
paths:
- '.github/workflows/*.yml'
- 'examples/**'
- 'tests/**'
- 'tools/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04 # use 20.04 to get python2
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install packages
run: source tools/ci.sh && ci_mpy_format_setup
- name: Test mpy-tool.py
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ on:
- 'tools/**'
- ports/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build ports download metadata
run: mkdir boards && ./tools/autobuild/build-downloads.py . ./boards
7 changes: 6 additions & 1 deletion .github/workflows/ports_cc3200.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ on:
- 'tools/**'
- 'py/**'
- 'extmod/**'
- 'shared/**'
- 'lib/**'
- 'drivers/**'
- 'ports/cc3200/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install packages
run: source tools/ci.sh && ci_cc3200_setup
- name: Build
Expand Down
Loading

0 comments on commit 78a55ca

Please sign in to comment.