Commit Graph

821 Commits

Author SHA1 Message Date
Bill Sideris 6dc179dc4a
Removed old supervisor stack setting code and revert some 'optimisations' 2023-02-16 13:33:37 +02:00
Bill Sideris a61a9f4bde
Size reductions (attempts, at the very least) 2023-02-16 13:12:21 +02:00
Bill Sideris f6e7edc900
Size reductions 2023-02-16 12:34:48 +02:00
Bill Sideris b00a25fecc
Merge branch 'adafruit:main' into settings-toml-pystack 2023-02-16 10:44:01 +02:00
Scott Shawcroft 931c7c1c51
Add Bangle.js 2, JDI memory displays and ACeP epd
This 2-in-1 PR started with the goal of support the Bangle.js 2
smartwatch with *no USB*.
* Adds "secure" DFU build support with a committed private key.
* Adds 3-bit color support with one dummy bit for the JDI memory display
* Allows nrf boards to have a board_background_task() run in RUN_BACKGROUND_TASK.
  This is needed because the Bangle.js 2 uses the watchdog to reset.
* Renamed port_background_task() to port_background_tick() to indicate it
  runs on tick, not RUN_BACKGROUND_TASK.
* Marks serial connected when the display terminal is inited. This means
  that safe mode messages show up on the display.

ACep, 7-color epaper displays also pack 3 bits in 4. So, I added that
support as well.
* Adds 3-bit ACeP color support for 7-color e-paper displays. (Not
  watch related but similar due to color depth.)
* Allows a refresh sequence instead of a single int command. The 7" ACeP
  display requires a data byte for refresh.
* Adds optional delay after resetting the display. The ACeP displays
  need this. (Probably to load LUTs from flash.)
* Adds a cleaning phase for ACeP displays before the real refresh.

For both:
* Add dither support to Palette.
* Palette no longer converts colors when set. Instead, it caches
  converted colors at each index.
* ColorConverter now caches the last converted color. It should make
  conversions faster for repeated colors (not dithering.)
2023-02-15 15:03:40 -08:00
Bill Sideris 133045a95a
Add error message and guardrail 2023-02-15 23:15:21 +02:00
Jeff Epler 73840f840d Improve boot_out.txt truncation
* write any partial message
 * instead of "..." show a sensible (translatable) message

This does slightly lower the amount of data that can be printed,
and makes the exact amount dependent on the language. However, if boot.py
intentionally needs to produce larger amounts of output, it can
deliberately mount the filesystem in RW mode and perform any writes needed.
In that case it's up to the boot.py to choose an appropriate way to
limit the number of writes if needed for the application.
2023-02-14 10:47:06 -06:00
Dan Halbert d46d9d5c21 shorten safe mode messages; improve message printing; fix CIRCUITPY_SAFEMODE_PY=0 2023-02-13 21:29:57 -05:00
Dan Halbert d8231f1588 Implement safemode.py 2023-02-13 18:26:38 -05:00
MicroDev a1644f15ea
use esp error for espnow 2023-02-03 15:42:44 +05:30
MicroDev 14c3b52b8d
Merge branch 'main' into espnow 2023-02-03 01:37:07 +05:30
MicroDev 7028a3adfe
rework espnow api 2023-02-03 01:32:28 +05:30
Dan Halbert c9e45433ff make translate 2023-02-01 14:03:52 -05:00
MicroDev ae4bb75e29
split espnow between bindings and common-hal 2023-02-01 18:53:58 +05:30
MicroDev cda5689263
move `esp32_camera` to `espcamera` 2023-01-27 22:05:43 +05:30
MicroDev 3c10dd8b5f
update espnow api 2023-01-23 23:51:10 +05:30
MicroDev f15e84de6c
update espnow module 2023-01-23 09:42:39 +05:30
Maciej Sokołowski e474df3a18 Add function for drawing polygons to bitmaptools 2023-01-20 23:14:38 +01:00
MicroDev 7330c638b9
minimal changes to make espnow work 2023-01-20 14:12:55 +05:30
Dan Halbert a974402542 Improve type validation errors messages, especially for pins 2023-01-10 15:02:55 -05:00
Dan Halbert 03b43b7b3f complete rework for microcontroller.cpu.frequency and wifi.radio MAC addresses 2023-01-02 11:45:58 -05:00
Dan Halbert a3adcf0e1a clarify read-only mac address; reuse translate msgs 2023-01-02 10:13:20 -05:00
Jeff Epler 785ebe1f41
Merge pull request #7382 from jepler/translate-name-not-known
Make the "name or service not known" message translatable
2022-12-27 12:15:52 -06:00
Jeff Epler 928fb0a9c4
Make the "name or service not known" message translatable 2022-12-26 13:58:31 -06:00
Jeff Epler 4dbbfa0931
Print errors to repl about getenv 2022-12-26 10:53:58 -06:00
Scott Shawcroft f8ac1d9261
Rework the coproc API
It is now a generic `memorymap` API and an ESP specific `espulp` module.

Fixes #7218. Fixes #3234. Fixes #7300.
2022-12-19 14:08:38 -05:00
Jeff Epler 499af3ed00
update source locations in translation file 2022-12-09 14:11:57 -06:00
Jeff Epler 19ad1d5f53
update translations 2022-12-08 14:12:59 -06:00
Jeff Epler ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
Scott Shawcroft 4c064c263e
Merge pull request #7294 from tannewt/analogbufio_rework
Rework the analogbufio API.
2022-12-02 14:53:16 -08:00
Jeff Epler ddc56f5fdf
Merge pull request #7101 from bill88t/picow-ap
Attempt at pi cow ap
2022-12-01 19:55:17 -06:00
Scott Shawcroft 255e997345
Rework the analogbufio API.
* read() is now readinto() and takes the buffer to write into.
* readinto() returns the number of valid samples.
* readinto() can be interrupted by ctrl-c.
* readinto() API doesn't support signed numbers because it never did.
* sample_rate is now required in the constructor because supported
  values will vary per-port.
* 16 bit values are full range. 12 bit samples from RP2040 are stretched
  in the same way they are for AnalogIn.

Fixes #7226
2022-12-01 17:46:07 -08:00
Dan Halbert 082b0d1aed
Merge pull request #7191 from jepler/fastpixelmap
Add a fast PixelMap-like class
2022-12-01 11:43:00 -05:00
Jeff Epler 19a3893d40
update translations again 2022-11-30 14:39:51 -06:00
Jeff Epler d39d146352
Merge some messages 2022-11-30 14:39:47 -06:00
Jeff Epler 0e19fbb60f
Use a function to raise ZeroDivisionError, consistent string 2022-11-30 14:39:30 -06:00
Bill Sideris 362018dcca
Merge branch 'main' into picow-ap 2022-11-30 19:11:03 +02:00
Dan Halbert c8390a7918
Merge pull request #7069 from jepler/exception-chain
Implement chained exceptions
2022-11-30 11:13:57 -05:00
Scott Shawcroft c13ca95da1
Add MDNS support to Pico W
This adds both cpy-MAC.local and circuitpython.local support.

Fixes #7214
2022-11-28 16:15:28 -08:00
foamyguy 19f1119994 Merge branch 'main' into fastpixelmap
# Conflicts:
#	shared-module/adafruit_pixelbuf/PixelBuf.c
2022-11-21 20:25:58 -06:00
Bill Sideris b40facd0b4
Error msg changes 2022-11-22 01:00:34 +02:00
Bill Sideris 88bd9ef6b8
just change the ap error 2022-11-18 22:51:05 +02:00
Bill Sideris b8cd6c093f
picow-ap progress 2022-11-17 21:47:39 +02:00
Jeff Epler b6f86e1e73
Recursively print chained exceptions 2022-11-13 19:53:21 -06:00
Jeff Epler f5c637dc10
Add adafruit_pixelmap.PixelMap
.. a fast helper for animations. It is similar to and inspired by the
PixelMap helper in Adafruit LED Animation library, but with an extremely
fast 'paste' method for setting a series of pixels. This is a common
operation for many animations, and can give a substantial speed improvement.

It's named `adafruit_pixelmap` so that we can package a compatible version
in pure Python for systems that can't fit it in C in flash, or for
Blinka.

This is a proof of concept and can make a very fast comet animation:
```python
import time
import adafruit_pixelbuf
import adafruti_pixelmap
import board
import neopixel
from supervisor import ticks_ms
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation import color

pixel_pin = board.GP0
pixel_num = 96

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB")

evens = adafruit_pixelmap.PixelMap(pixels, tuple(range(0, pixel_num, 2)))
odd_indices = tuple((i, i+2) for i in range(1, pixel_num, 4))
print(odd_indices)
odds = adafruit_pixelbuf.PixelMap(pixels, odd_indices)
assert len(odds) == len(odd_indices)


comet_length = 16

comet1 = [color.calculate_intensity(color.GREEN, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]
comet2 = [color.calculate_intensity(color.PURPLE, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]

pos1 = 0
pos2 = 96//4

while True:
    evens.paste(comet1, pos1, wrap=True, reverse=False, others=0)
    pos1 = (pos1 + 1) % len(evens)

    odds.paste(comet2, pos2, wrap=True, reverse=True, others=0)
    pos2 = (pos2 - 1) % len(odds)
    pixels.show()

    m = ticks_ms()
    if m % 2000 > 1000:
        time.sleep(.02)
```
2022-11-11 07:54:33 -06:00
Dan Halbert e6936decac
Merge pull request #7169 from blues/pdmin
STM32L4 PDMIn support
2022-11-09 14:19:51 -05:00
Jeff Epler 9cdfba2e47
Simplify argument checking to reduce translated strings
Build size on proxlight trinkey m0 en_US:
Before:  2412 (en_US)  820 (ru)
After:   2544 (en_US)  984 (ru)
Savings: +132 (en_US) +164 (ru) bytes available flash
2022-11-07 12:37:11 -06:00
Matthew McGowan ad9db01f5f Implements PDMIn for STM32L4 using the SAI peripheral and decimation/filtering in software. 2022-11-04 17:27:08 -07:00
Neradoc 8f82db5b22 define out the safe mode message if none 2022-10-30 03:55:59 +01:00
Neradoc 0aa41fa92e change BOARD_USER_SAFE_MODE_ACTION into a separate sentence 2022-10-30 01:55:42 +02:00
CDario 19fd9107a2 Merded with main branch 2022-10-29 07:46:54 +00:00
CDario b815a4cc5e Added safe mode button and fix coyright attribution 2022-10-28 12:06:11 +00:00
CDario b94447fde5 Added safe mode button 2022-10-28 05:00:54 +00:00
microDev 83b54d003d
implement more checks in coproc module
- check memory address range
- check firmware size at an earlier stage
2022-10-22 19:05:48 +05:30
microDev b33a2b45dc
add coproc alarm 2022-10-20 18:38:20 +05:30
microDev 5232e3f6c3
add coproc module 2022-10-20 09:09:44 +05:30
microDev e7b25dbf73
improve `dualbank` errors 2022-10-15 13:20:10 +05:30
Dan Halbert 7e4b2a09eb
Merge pull request #7000 from MicroDev1/storage-extend
Add Storage Extension Support
2022-10-13 10:05:55 -04:00
microDev 728fea4ca4
add storage extension python api 2022-10-13 09:53:33 +05:30
Dan Halbert 86a0f9a861 save about 112 bytes 2022-10-09 19:22:39 -04:00
Dan Halbert 833f55922c
Remove multiterminal
This module has not been built in years, since the (removed) esp8266 port.
Delete the code, as it is not likely to be useful in its current form.

Closes: #7015
2022-10-06 14:02:47 -05:00
Jeff Epler dcb650c513 pico w: add ssl module
Note: at this time, the ssl module on pico_w never verifies the server
certificate. This means it does not actually provide a higher security
level than regular socket / http protocols.
2022-10-05 13:12:43 -04:00
Dan Halbert db065a299f
Merge pull request #6933 from jepler/🥧🐮
Implement a useful subset of `wifi` and `socketpool` modules on 🥧🐮
2022-09-28 18:09:24 -04:00
Jeff Epler 6c3cdceb45
Implement scan, connect, ping
My pings go out, and then they come back

```py
import os
import wifi
import ipaddress

wifi.radio.connect(os.getenv('WIFI_SSID'), os.getenv('WIFI_PASSWORD'))
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % (wifi.radio.ping(ipv4)*1000))
```
2022-09-28 10:06:33 -05:00
Jeff Epler 346fff2e7c
cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00
Jeff Epler ef35ca1d3e
vectorio: Simplify argument checking of x/y values 2022-09-22 08:39:33 -05:00
Jeff Epler 267ec1dc4f
unify some 'must/should be an int' messages 2022-09-22 08:39:32 -05:00
Dan Halbert 6f8fe1b3e1 touch up analogbufio ValueError msg; consolidate with another message 2022-09-16 11:17:13 -04:00
Dan Halbert 8a568d18b5
Merge pull request #6757 from latkinso42/adcdma
analogbufio
2022-09-16 08:32:24 -04:00
Dan Halbert 60f43b1703 allow preserving pin state during deep sleep 2022-09-15 17:35:14 -04:00
latkinso42 c1f57c6ceb Pushing for resolution 2022-09-07 18:53:35 -04:00
latkinso42 6fe2ea4513 Merging back with updated main files 2022-09-02 15:51:45 -04:00
Jeff Epler dc27fb967d error at runtime if no psram actually reserved 2022-08-26 09:27:50 -05:00
Lee Atkinson f91af513b7 Introduced odule adcbuffer / removed analogio/AnalogFastIn 2022-08-18 16:23:17 -04:00
Lee Atkinson c3c1e307c4 Sample Rate Enhancements 2022-08-11 17:50:30 -04:00
Scott Shawcroft 554063a817
Merge branch 'main' into espressif-camera-2 2022-08-09 14:07:14 -07:00
Dan Halbert 84807cd6eb Change I2C terminology from "peripheral" to "target" 2022-08-09 13:13:19 -04:00
Jeff Epler 1a11ff864a
Merge remote-tracking branch 'origin/main' into espressif-camera-2 2022-08-05 21:08:12 -05:00
Scott Shawcroft 207311b02a
Merge branch 'main' into title_execution_status 2022-08-05 13:42:58 -07:00
Scott Shawcroft 83cbbc9946
Add BLE status to title bar 2022-08-04 16:33:10 -07:00
Scott Shawcroft 3a2bcbc5c7
Enable title bar on all builds
* Tweak scroll area position so last line is complete and top is
  under the title bar.
* Pick Blinka size based on the font to minimize unused space in
  title bar. Related to #2791
* Update the title bar after terminal is started. Fixes #6078

Fixes #6668
2022-08-04 16:33:10 -07:00
Jeff Epler 258f72640a
Implement a pile of getters & setters 2022-08-04 15:11:57 -05:00
Jeff Epler 82be75adb5 Add ability to reserve psram
.. the primary user of which will be the camera, since the framebuffers
must be allocated via esp-idf allocation function and never from the
gc heap.

A board can have a default value, and the value can also be set in the
/.env file using the key CIRCUITPY_RESERVED_PSRAM with the value being
the reserved size in bytes.

Co-authored-by: Dan Halbert <halbert@adafruit.com>
2022-08-03 16:19:40 -05:00
Scott Shawcroft 9661d3256c
Add more ESP32 boards and enable web workflow 2022-08-01 15:52:08 -07:00
Dan Halbert bb47484cb1 Merge remote-tracking branch 'adafruit/main' into from_bytes-check-parameters 2022-07-19 17:18:26 -04:00
Scott Shawcroft ac460dd1e1
Merge branch 'main' into esp32 2022-07-13 15:30:53 -07:00
Scott Shawcroft 23bbb19138
Merge remote-tracking branch 'adafruit/main' into websocket_serial 2022-07-12 13:15:38 -07:00
Dan Halbert 2c7ad7a39f make translate and pre-commit formatting fixes 2022-07-08 16:53:53 -04:00
Jeff Epler 1c3655c07b
update translations 2022-07-07 13:28:54 -05:00
Isaac Benitez 4d3ab4f4fc Added non-keyword args to allowed_args 2022-07-06 07:22:45 -07:00
Isaac Benitez ac9cb9389c Check parameters of int.from_bytes 2022-07-05 22:37:33 -07:00
Scott Shawcroft 7589e53fea
WIP websocket accept and hashlib 2022-07-01 10:18:33 -07:00
Scott Shawcroft d42c811fb9
Safe mode when ESP interrupt watchdog fires
This makes us enter safe mode when sleep on the S3 fails. The
task watchdog is used for the user watchdog.
2022-06-29 12:31:18 -07:00
Scott Shawcroft 6446010753
Wi-Fi autoconnect and title bar status
This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD
in `/.env`. When both are defined, CircuitPython will attempt to
connect to the network even when user code isn't running. If the
user code attempts to a network with the same SSID, it will return
immediately. Connecting to another SSID will disconnect from the
auto-connected network. If the user code initiates the connection,
then it will be shutdown after user code exits. (Should match <8
behavior.)

This PR also reworks the default displayio terminal. It now supports
a title bar TileGrid in addition to the (newly renamed) scroll area.
The default title bar is the top row of the display and is positioned
to the right of the Blinka logo when it is enabled. The scroll area
is now below the Blinka logo.

The Wi-Fi auto-connect code now uses the title bar to show its
state including the IP address when connected. It does this through
the "standard" OSC control sequence `ESC ] 0 ; <s> ESC \` where <s>
is the title bar string. This is commonly supported by terminals
so it should work over USB and UART as well.

Related to #6174
2022-06-09 14:55:54 -07:00
Dan Halbert 309dab4c75 merge 7.3.0-rc.1 changes to main 2022-05-20 15:37:56 -04:00
Dan Halbert f63b26c534 address jepler's comments and further squeezes 2022-05-20 10:10:55 -04:00
Dan Halbert a01dec1df9 message consolidation and more use of validators 2022-05-19 15:38:37 -04:00
Dan Halbert 4487f61404 Restore automatic gc_collect() after an import 2022-05-18 11:37:13 -04:00
Dan Halbert 936f5bf23e
Merge pull request #6338 from jepler/fix-display-invalid-sh1107
Fix display invalid sh1107
2022-05-13 20:33:43 -04:00
Dan Halbert ae8347f5e5 add error msg for SH1107 fix 2022-05-13 12:54:46 -04:00