Commit Graph

4990 Commits

Author SHA1 Message Date
Jeff Epler f11ef4cc4e
makeversionhdr should be unforgiving
Recently(?) github started making it the default to only copy a single
branch (e.g., main) and NO TAGS into new forks.

This makes the step of the build process that determines the CircuitPython
version not work, because tags are expected to be present. When tags are
not present, the version number is only a git hash. The version number
ends up being 0.0.0.

This causes problems with libraries that check for CircuitPython version
to determine compatibility, among other things.

We'll do other things to improve the situation, such as document it.
But it'd also be good if the build stopped when this detectable condition
occurs.
2022-09-16 10:28:53 -05:00
Dan Halbert 6bb47038d5 Merge remote-tracking branch 'adafruit/main' into adcdma 2022-09-15 20:42:51 -04:00
Jeff Epler 56112e00a1 Give fontio its own enable
.. the default is intended to be the equivalent of the original,
implementing `DISPLAYIO && TERMINALIO`.

This is a possible alternative to #6889, if I understand the intent.
2022-09-11 08:09:14 -05:00
Lee Atkinson f279a2dbb2
Merge branch 'adafruit:main' into adcdma 2022-09-08 11:46:01 -04:00
latkinso42 a1856ea3e9 Renaming module from adcbuffer to analogbufio 2022-09-05 12:11:49 -04:00
Dan Halbert 52080e24eb status bar control 2022-08-30 15:23:44 -04:00
Lee Atkinson 6fd08483e2 Tidying code for PR/ Minor Issues 2022-08-24 17:41:51 -04:00
Lee Atkinson f5655dd48c Fixing Build errors/ DMA Xfer Rate 2022-08-21 11:44:40 -04:00
Lee Atkinson 61591ac136 adding __init.c to circuitpy_defs.mk 2022-08-19 13:17:37 -04:00
Lee Atkinson d3c3c9eac4 Tidy a few things 2022-08-18 19:10:16 -04:00
Lee Atkinson f91af513b7 Introduced odule adcbuffer / removed analogio/AnalogFastIn 2022-08-18 16:23:17 -04:00
Lee Atkinson 34b8fbaf14
Merge branch 'adafruit:main' into adcdma 2022-08-18 09:08:10 -04:00
Scott Shawcroft 7717ab8e13
Merge pull request #6754 from jepler/check-read-utf8
When reading data from a file into a str, check if it's utf-8
2022-08-15 13:48:43 -07:00
Lee Atkinson c53c1c0927 Adding py/circuitpy_mpconfig.mk 2022-08-14 18:49:59 -04:00
Lee Atkinson b2c6bcdf6d Fixing py/circuitpy_defns.mk 2022-08-14 14:22:22 -04:00
Lee Atkinson 4542c801b0 Tidying up loose endson draft PR 2022-08-14 13:03:33 -04:00
Jeff Epler 06f22cb59c
When reading data from a file into a str, check if it's utf-8
Otherwise, weird stuff can happen down the line when it is print()ed,
especially as it can break the webrepl of circuitpython.
2022-08-12 08:25:27 -05:00
Lee Atkinson 5fb5fd0558
Merge branch 'adafruit:main' into adcdma 2022-08-10 18:33:52 -04:00
Scott Shawcroft 741a5c2bec
Merge pull request #6722 from dhalbert/micropython-float-print-fix
py/formatfloat: Format all whole-number floats exactly.
2022-08-10 09:32:28 -07:00
Lee Atkinson e778112710
Merge branch 'adafruit:main' into adcdma 2022-08-10 10:29:17 -04:00
Lee Atkinson 9e0c580d3d AnalogFastIn 2022-08-10 09:42:24 -04:00
Scott Shawcroft 554063a817
Merge branch 'main' into espressif-camera-2 2022-08-09 14:07:14 -07:00
Dan Ellis 9b5e00fcc5 py/formatfloat: Format all whole-number floats exactly.
Formerly, py/formatfloat would print whole numbers inaccurately with
nonzero digits beyond the decimal place.  This resulted from its strategy
of successive scaling of the argument by 0.1 which cannot be exactly
represented in floating point.  The change in this commit avoids scaling
until the value is smaller than 1, so all whole numbers print with zero
fractional part.

Fixes issue #4212.

Signed-off-by: Dan Ellis dan.ellis@gmail.com
2022-08-09 13:43:47 -04: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 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 5db6db0128
add esp32-camera
This uses the esp32-camera code instead of our own homebrewed camera code.
In theory it supports esp32, esp32-s2 and esp32-s3, as long as they have
PSRAM.

This is very basic and doesn't support changing any camera parameters,
including switching resolution or pixelformat.

This is tested on the Kaluga (ESP32-S2) and ESP32-S3-Eye boards.

First, reserve some PSRAM by putting this line in `CIRCUITPY/_env`:
```
CIRCUITPY_RESERVED_PSRAM=524288
```
and hard-reset the board for it to take effect.

Now, the following script will take a very low-resolution jpeg file and print
it in the REPL in escape coded form:

```python
import board
import esp32_camera

c = esp32_camera.Camera(
    data_pins=board.CAMERA_DATA,
    external_clock_pin=board.CAMERA_XCLK,
    pixel_clock_pin=board.CAMERA_PCLK,
    vsync_pin=board.CAMERA_VSYNC,
    href_pin=board.CAMERA_HREF,
    pixel_format=esp32_camera.PixelFormat.JPEG,
    i2c=board.I2C(),
    external_clock_frequency=20_000_000)

m = c.take()
if m is not None:
    print(bytes(m))
```

Then on desktop open a python repl and run something like
```python
>>> with open("my.jpg", "wb") as f: f.write(<BIG PASTE FROM REPL>)
```
and open my.jpg in a viewer.
2022-08-04 15:11:50 -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
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 8093f8e555
Default gifio to camera setting 2022-07-12 14:12:25 -07:00
Dan Halbert 2c7ad7a39f make translate and pre-commit formatting fixes 2022-07-08 16:53:53 -04:00
Dan Halbert c316b950c7 merge from adafruit/main 2022-07-08 15:42:19 -04:00
Dan Halbert d869b441f4 further ESP32 sdkconfig fixes; add CIRCUITPY_STATUS_BAR 2022-07-08 15:27:00 -04:00
Dan Halbert afbf4de071 Uncomment or remove debugging changes 2022-07-08 12:53:25 -04:00
Dan Halbert 75208573f4 tweak sdkconfig; add temp logging to mp_make_function_from_raw_code 2022-07-08 09:53:29 -04:00
Dan Halbert 4e88d795e1 Thonny causing crash emitglue.c:199: 2022-07-06 23:01:19 -04: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 07b2697ae3
WIP websocket to serial 2022-07-01 16:57:10 -07:00
Scott Shawcroft 7589e53fea
WIP websocket accept and hashlib 2022-07-01 10:18:33 -07:00
Dan Halbert 8bb369cac5 refactor debug UART to console UART; get working on ESP32 2022-06-30 23:16:46 -04:00
Jeff Epler 6a833a77cc
modbuiltins: Catch most exceptions during dir()
This helps with Python-compatibility (see issue #4171) but doesn't
completely resolve it.

Now, `dir()` still computes any properties of the underlying object,
HOWEVER, if the property raises an exception this expression is
captured.

This ability to capture exceptions always existed in
`mp_load_method_protected`, we just need to turn it on via the
`catch_all_exc` boolean parameter.
2022-06-30 15:21:04 -05:00
Scott Shawcroft 0c418e98b1
Merge remote-tracking branch 'adafruit/main' into auto_wifi 2022-06-13 15:44:43 -07:00
Scott Shawcroft 1a3d2a5b5e
Shrink nrf52833 builds
Make them CIRCUITPY_FULL_BUILD = 0 and rework the boards to have
the same modules enabled (ish.)

Also make ZLIB require FULL_BUILD and disable advanced `micropython`
module APIs by default on all builds.
2022-06-13 15:36:15 -07:00
Roberto Tyley 09091ecb83 Enable collections deque for CIRCUITPY_FULL_BUILD
I'd like to use `collections.deque`:

https://docs.circuitpython.org/en/latest/docs/library/collections.html#collections.deque

...on my RP2040-based Keybow 2040 (https://circuitpython.org/board/pimoroni_keybow2040/).

For MicroPython, `collections.deque` is enabled for all `rp2` devices,
because they all have `MICROPY_CONFIG_ROM_LEVEL` set to 'extra features':

cf7d962cf3/ports/rp2/mpconfigport.h (L44)

...which includes `MICROPY_PY_COLLECTIONS_DEQUE` (see
6bda80d811/py/mpconfig.h (L1225-L1227) ).

For CircuitPython, it looks like `MICROPY_CONFIG_ROM_LEVEL` defaults to
'core' (`MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES`) and isn't updated
against any of the ports, so the only port getting `collections.deque`
is the `unix` port, which explcitly sets `MICROPY_PY_COLLECTIONS_DEQUE`:

6925a00138/ports/unix/mpconfigport.h (L134)

At Dan Halbert's suggestion...

https://github.com/adafruit/circuitpython/pull/6474#issuecomment-1152364768

... this commit enables `MICROPY_PY_COLLECTIONS_DEQUE` for all builds where
`CIRCUITPY_FULL_BUILD` is true - which includes Raspberry Pi:

6925a00138/ports/raspberrypi/mpconfigport.mk (L11)

See also:

* https://github.com/adafruit/circuitpython/issues/5734
* 970eedce8f
  which originally added collections.deque to MicroPython
2022-06-10 15:29:22 +01: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
Scott Shawcroft be67067809
Merge remote-tracking branch 'adafruit/main' into translate_header 2022-06-03 15:18:18 -07:00
Scott Shawcroft 8ccb955475
Move translation .o to PY_CORE_O 2022-06-03 15:06:58 -07:00