.. _changelog_v1_1_0: v1.1.0 ====== v1.1.0 is the foundational architecture release: it drops the early custom peripheral modules in favor of standard **MicroPython built-ins**, moves the imaging API into the :mod:`image` module and the frame-rate clock into :mod:`time`, and adds built-in Haar cascades, ``get_pixel()`` / ``set_pixel()``, OpenMV 2 board support, and USB-CDC debugging. It is a heavily breaking, API-defining release — read the breaking changes below. .. contents:: On this page :local: :depth: 1 Highlights ---------- - **MicroPython built-ins** — the custom ``gpio`` / ``led`` / ``spi`` / :mod:`socket` / ``wlan`` / ``uart`` / ``file`` / :mod:`select` modules were removed in favor of MicroPython's :mod:`pyb` / :mod:`machine`. - :mod:`image` module — ``Image()`` / ``HaarCascade()`` / descriptors are now in the :mod:`image` module. - :class:`time.clock` — the frame-rate clock moved into the :mod:`time` module. - **Built-in Haar cascades** — ``HaarCascade("frontalface")`` / ``HaarCascade("eye")`` (no file needed). - **OpenMV 2** board support and USB-CDC debugging. - **Breaking:** the module structure was redefined — see the breaking changes. New features ------------ - **Image** — added ``Image.get_pixel(x, y)`` / ``set_pixel()`` and ``img[i]`` subscript pixel access; built-in flash Haar cascades (``HaarCascade("frontalface")`` / ``HaarCascade("eye")``) and a ``stages=`` keyword to limit cascade stages; ``draw_string()`` works on grayscale images. - **Sensor** — added :func:`sensor.set_colorbar`, :func:`sensor.set_saturation`, and the ``QQVGA2`` framesize. - ``mlx`` — ``mlx.read(type)`` with ``mlx.RAINBOW`` / ``mlx.GRAYSCALE`` output. - **Debugging** — implemented debugging over USB CDC, a firmware ``fw_version()`` query, per-board firmware (OpenMV 1 / OpenMV 2), and self-test / colorbar scripts; fatal/parse errors are logged to flash. Other changes and improvements ------------------------------ - Out-of-memory now raises ``MemoryError`` instead of ``OSError``; scripts run with exception re-raise so errors print instead of crashing; the serial baud rate is configurable (default 921600); a larger flash filesystem; the sensor pixel clock was lowered to 54 MHz for capture stability; :func:`sensor.reset` relies on a sensor soft reset only. Bug fixes --------- - Fixed template matching, ``find_features()`` repeating the first object, SCCB/I2C atomic register access, SD-card chip detect, soft-I2C pin mapping, ``fast_cbrtf`` / LAB color accuracy, and integral-image / median-filter memory use on the OpenMV 1 / 2. Hardware and board support -------------------------- - **OpenMV 2** (STM32F427) board support (and OpenMV 3 hardware design); MCO used as the sensor clock on the OpenMV 2. Breaking API changes -------------------- User-visible API breaks between v1.0.3-beta and v1.1.0. Scope: Python C-modules in ``modules/`` and Python libraries in ``scripts/libraries/``. Each change is tagged with its impact: - *major* — affects most scripts that used the feature; you will need to port code. - *behavior* — same API, different results; re-check tuned scripts. Changes are grouped by impact in that order. If you just want to port your code, jump to the :ref:`migration checklist ` at the end. Each commit hash links to its diff on GitHub. .. _v1_1_0_custommodules: Custom peripheral modules removed *(major)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The early custom ``clock`` / ``file`` / ``gpio`` / ``led`` / :mod:`select` / :mod:`socket` / ``spi`` / ``wlan`` / ``uart`` modules were removed in favor of MicroPython's built-in :mod:`pyb` / :mod:`machine` peripherals. Port scripts to the standard MicroPython equivalents (e.g. :class:`pyb.Pin` / :class:`pyb.LED` / :class:`pyb.SPI` / :class:`pyb.UART`). *Commits:* `6d2fafa94 `__ .. _v1_1_0_image: Imaging API moved into the :mod:`image` module *(major)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``Image()``, ``HaarCascade()``, and the descriptor save/load functions are no longer bare builtins — they live in the new :mod:`image` module. Scripts must ``import image`` and use :class:`image.Image` / :func:`image.HaarCascade`. *Commits:* `54288c535 `__ .. _v1_1_0_clock: Frame-rate clock moved into :mod:`time` *(major)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The standalone ``clock`` module was removed; the frame-rate clock now lives in :mod:`time`. Use ``import time`` and ``clock = time.clock()`` — the returned object still provides ``.tick()`` / ``.fps()`` / ``.avg()`` / ``.reset()``. *Commits:* `a8928ca3b `__ .. _v1_1_0_syspath: ``/flash`` and ``/sd`` no longer added to ``sys.path`` *(behavior)* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The volume labels / root directory were fixed and ``/flash`` and ``/sd`` are no longer auto-appended to ``sys.path``. Scripts that imported helper modules by bare name from those locations must add the path explicitly (or place modules where they are found). *Commits:* `09e77b5da `__ .. _v1_1_0_migration: Migration checklist ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For a clean port to v1.1.0 the typical work is: #. Replace the custom ``gpio`` / ``led`` / ``spi`` / ``uart`` / :mod:`socket` / ``wlan`` / ``file`` / :mod:`select` modules with MicroPython :mod:`pyb` / :mod:`machine` (:ref:`the custom-module removal `). #. ``import image`` and prefix ``Image()`` / ``HaarCascade()`` with ``image.`` (:ref:`the image module move `). #. Use ``import time`` and ``clock = time.clock()`` (:ref:`the clock move `). #. Add ``/flash`` / ``/sd`` to ``sys.path`` explicitly if you imported helper modules by bare name (:ref:`the sys.path change `). All other scripts run unchanged.