summaryrefslogtreecommitdiff
path: root/shared-bindings
AgeCommit message (Collapse)Author
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-01Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-06-01Merge branch 'master' into update-ulabScott Shawcroft
2020-06-01Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-06-01ulab: docs: Fix markup errorJeff Epler
2020-06-01fix spellingJeff Epler
2020-06-01ulab: updateJeff Epler
.. add new modules and functions to our shared-bindings stubs
2020-05-31shared-bindings: Fix docs of storage.VfsFatJeff Epler
This is almost, but not entirely, a whitespace change. "..." was missing or mis-placed in several places The invalid syntax 'def f(self, ):' was used in several places.
2020-05-29Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-05-27Various doc examples: Fix the "/ 18" copypasta bugJeff Epler
2020-05-27Remove NONE from mode enum and doc tweaksScott Shawcroft
2020-05-27watchdog: use common_hal_watchdog_* patternSean Cross
This pulls all common functionality into `shared-bindings` and keeps platform-specific code inside `nrf`. Additionally, this performs most validation in the `shared-bindings` site. The only validation that occurs inside platform-specific `common-hal` code is related to timeout limits that are platform-specific. Additionally, all documentation is now inside the `shared-bindings` directory. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: support catching the timeoutSean Cross
With this patch, the exception can now be caught: import microcontroller import watchdog import time wdt = microcontroller.watchdog wdt.timeout = 5 while True: wdt.mode = watchdog.WatchDogMode.RAISE print("Starting loop -- should exit after five seconds") try: while True: time.sleep(10) # pass # This also works for a spinloop except watchdog.WatchDogTimeout as e: print("Watchdog Expired (PASS)") except Exception as e: print("Other exception (FAIL)") print("Exited loop") This prints: Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Starting loop -- should exit after five seconds Watchdog Expired (PASS) Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: move timeout exception to shared-bindingsSean Cross
Make this exception globally available to all platforms that have enabled the watchdog timer. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdogtimer: refactor to new apiSean Cross
This refactors the WatchDogTimer API to use the format proposed in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227 Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: fix documentation build errorSean Cross
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: rename module from `wdt` and move to `microcontroller`Sean Cross
This also places it under the `microcontroller` object. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27wdt: add watchdog supportSean Cross
This adds shared bindings for a watchdog timer, based on the API provided by micropython. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-26Merge pull request #2931 from tannewt/esp32s2_digitalioDan Halbert
Finish digitalio and pin use tracking for ESP32S2
2020-05-26Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalioScott Shawcroft
2020-05-24Adjust docs to reflect behaviour.Roy Hooper
2020-05-22Simplify pixelbuf set_pixels functionGeorge Waters
2020-05-22Use mp_int_t for setting pixelbuf slice indicesGeorge Waters
When handling negative steps, start and stop need to be mp_int_t so they can be checked against a potential negative value during the for loop used to set the slice values.
2020-05-21Implement negative step for pixelbuf slicesGeorge Waters
2020-05-21Merge branch 'master' into esp32s2_digitalioScott Shawcroft
2020-05-20Fix error when getting a pixelbuf sliceGeorge Waters
2020-05-20Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalioScott Shawcroft
2020-05-19Fully implement digitalio and pin-in-use tracking.Scott Shawcroft
Fixes #2901
2020-05-19bleio: adapter: add advertising timeout and statusSean Cross
Add a field to allow specifying a timeout when initiating advertising. As part of this, add a new property to determine if the device is still advertising. Additionally, have the `anonymous` property require a timeout, and set the timeout to the maximum possible value if no timeout is specified. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19_bleio: support anonymous advertisingSean Cross
Add a new parameter to the `start_advertising()` function to enable anonymous advertising. This forces a call to `sd_ble_gap_privacy_set()` with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and `private_addr_type` set to `BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`. With this, addresses will cycle at a predefined rate (currently once every 15 minutes). Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18Merge pull request #2837 from k0d/serial-debugScott Shawcroft
Add support for a debug console, such as ST-Link VCP.
2020-05-19Enable showing the console on a debug uartMark Olsson
2020-05-18remove a duplication in polygon.cwarriorofwire
2020-05-18vectorio: speed up polygonwarriorofwire
This change takes polygon from 126k pixels per second fill to 240k pps fill on a reference 5 point star 50x66px polygon, updating both location and shape at 10hz. Tested on an m4 express feather. As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;` fills just shy of 375k pixels per second.
2020-05-16Added DigitalInOut suggestionppolk-nocimed
2020-05-16Fixed Optional[Pull]ppolk-nocimed
2020-05-16Digital In Out Type Hintsppolk-nocimed
2020-05-15Note that nvm.ByteArray is available at microcontroller.nvmThea Flowers
Fixes #2766
2020-05-15Merge pull request #2810 from dherrada/masterScott Shawcroft
Pyi integration
2020-05-15aesio: specify writable buffers for destination buffersSean Cross
When calling `AES.decrypt_into()` or `AES.encrypt_into()`, the destination buffers may be any buffer kind. However, we currently aren't checking to make sure the destination buffer is actually writable. Specify `MP_BUFFER_WRITE` for the destination buffers of both of these objects so we don't inadvertently write to immutable data. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-15aesio: use bufinfo rather than mp_str_bytesSean Cross
In order to accept both `bytes` objects and `bytearray` objects, use a `bufinfo` construct to retrieve the data rather than `mp_obj_str_get_data()`. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-14Fix help docScott Shawcroft
2020-05-14Fix ulab, math and template.Scott Shawcroft
2020-05-14Fixed minor indentation issuedherrada
2020-05-13Merge pull request #2889 from jepler/gamepad-tickScott Shawcroft
Gamepad, GamepadShift: Fix after lower-power by enabling supervisor tick
2020-05-13Update countio to python stub docsScott Shawcroft
2020-05-13Merge remote-tracking branch 'adafruit/master' into improve_verificationScott Shawcroft
2020-05-13Gamepad & GamepadShift: Initially allocate as long-livedJeff Epler
This makes less heap churn and decreases code size a tiny bit
2020-05-13Gamepad & GamepadShift: Enable ticks while object existsJeff Epler
Otherwise, button presses might not be noticed.
2020-05-12Move vectorio to stubsScott Shawcroft