Commit Graph

5120 Commits

Author SHA1 Message Date
foamyguy
57d7f7f2ad move to _pixelmap 2022-11-24 09:07:08 -06:00
Dan Halbert
6d022733b3
Merge pull request #7162 from rhooper/boards-list
add boards list to make error message
2022-11-21 23:18:37 -05:00
MicroDev
c3c1717813
refactor common port specific Makefile code 2022-11-18 23:00:28 +05:30
Jeff Epler
dd443bacb8
Chain exceptions while unwinding 2022-11-13 19:53:23 -06:00
Jeff Epler
b6f86e1e73
Recursively print chained exceptions 2022-11-13 19:53:21 -06:00
Jeff Epler
f3169246ba
Implement chained exceptions
This adds the __cause__, __context__ and __suppress_context__
members to exception objects and makes e.g., `raise exc from cause`
set them in the same way as standard Python.
2022-11-13 19:52:50 -06:00
Jeff Epler
b499275bb5
Don't crash when assigning attributes of the GeneratorExit const singleton 2022-11-13 19:52:49 -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
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
Jeff Epler
05252c87f4
Don't crash when assigning attributes of the GeneratorExit const singleton 2022-10-22 11:37:34 -05:00
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
Jeff Epler
068b7c4af8
Use micropython #defines for stream polling operations
We adopted the file "py/ioctl.h" and the ioctl names beginning
with MP_IOCTL_POLL while micropython went with "py/stream.h" and
MP_STREAM_POLL.

Align with upstream.

Closes #6711
2022-10-14 12:15:30 -05:00
Dan Halbert
8825e7f241
Merge pull request #6397 from jepler/extra-memset
Some flash size optimizations related to string0.c (implementation of str/mem functions)
2022-10-13 12:34:59 -04:00
Dan Halbert
7e4b2a09eb
Merge pull request #7000 from MicroDev1/storage-extend
Add Storage Extension Support
2022-10-13 10:05:55 -04:00
Dan Halbert
86a0f9a861 save about 112 bytes 2022-10-09 19:22:39 -04: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
ed87579a65 add missing native modules to support matrix 2022-10-04 19:22:18 -04:00
microDev
9fe7308b88
conditionally add storage extension 2022-10-04 17:26:28 +05:30
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
Dan Halbert
a7b10d41b4
Merge pull request #6522 from jepler/must-be-int
Improve argument checking & reduce strings to translate
2022-09-25 17:55:56 -04:00
Dan Halbert
de80db681f
Merge pull request #6915 from dhalbert/ringbuf-cleanup
ringbuf cleanup
2022-09-25 17:50:21 -04:00
Jeff Epler
18cb25e95c
Re-use another message 2022-09-22 08:39:34 -05:00
Dan Halbert
ea15a9118a ringbuf cleanup 2022-09-21 10:03:05 -04:00
Dan Halbert
c567b43441 add CIRCUITPY_USB_IDENTIFICATION to turn off on smallest builds 2022-09-20 14:32:38 -04:00
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
Jeff Epler
162fa6ef02
Merge remote-tracking branch 'origin/main' into extra-memset 2022-07-25 06:51:59 -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
Jeff Epler
91e15af84e
fix diagnostic when building unix port for tests 2022-06-27 09:49:00 -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
Jeff Epler
4f27337207
Only check the savings if a word occurs at least twice
Profiling shows that `est_net_savings` is one of the highest costs of
the whole process. Approximately, you can save storage only if a word
appears more than once, and doing this greatly reduces the number
of `est_net_savings` calls. Locally, it reduces the time for this
specific build step by 50% on ports/unix coverage build, without
affecting the size of the generated binary.
2022-06-02 21:25:28 +02:00
Scott Shawcroft
fd5ef009a4
Move compressed strings into own object file
This breaks the translation dependency to all of the other objects
and therefore speeds up subsequent builds. Now, even when the big
translate() function is inlined in the header, it only needs to be
optimized once.
2022-06-02 11:48:56 -07:00
Scott Shawcroft
09c61efcff
Split partition from LTO enable 2022-06-01 11:12:14 -07:00
Scott Shawcroft
7fc0aa5791
Fix windows and two samd builds 2022-05-31 14:48:41 -07:00
Scott Shawcroft
4d776339ad
Separate translate object control from LTO 2022-05-31 12:42:59 -07:00
Scott Shawcroft
8d559196ed
Fix unix and pre-commit 2022-05-27 15:48:01 -07:00
Scott Shawcroft
9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00
Scott Shawcroft
c676253834
Switch translate() to the header file
This allows the compile stage to optimize most of the translate()
function away and saves a ton of space (~40k on ESP). *However*, it
requires us to wait for the qstr output before we compile the rest
of our .o files. (Only qstr.o used to wait.)

This isn't as good as the current setup with LTO though. Trinket M0
loses <1k with this setup.

So, we should probably conditionalize this along with LTO.
2022-05-27 10:33:53 -07:00
Scott Shawcroft
dc5565a5ce
Merge pull request #6436 from dhalbert/judicious-lto
LTO: Use -flto and -flto-partition only as needed
2022-05-27 10:31:06 -07:00
Dan Halbert
d631ec38c6
Merge pull request #6407 from tannewt/dotenv
Add dotenv read support
2022-05-26 12:11:33 -04:00
Dan Halbert
95fc7e4713 harmless change to force all ports to build 2022-05-26 11:52:58 -04:00
Dan Halbert
1fb210bd40
Merge pull request #5491 from pypewpew/remove-gamepadshift
Remove gamepadshift module
2022-05-25 13:58:06 -04:00
Radomir Dopieralski
c0152e7dab Remove gamepadshift module
Everything should be using the keypad module instead.

Note: there are several boards that still had gamepadshift enabled. I
did not contact their authors to make sure they already switched to
keypad in their code and documentation. We should probably wait with
merging this for their go ahead.
2022-05-25 00:48:55 +02:00
Scott Shawcroft
a6b60d2083
Merge remote-tracking branch 'adafruit/main' into dotenv 2022-05-23 11:23:20 -07:00
Dan Halbert
9c643aa907 Merge branch '7.3.x' into merge-7.3.0-rc.1-to-main 2022-05-21 12:57:46 -04:00
Dan Halbert
199e2ef2fc Turn on f-strings for all builds 2022-05-21 00:04:53 -04: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
Scott Shawcroft
a30de85d57
Add dotenv read support
os.getenv() will use it (when available) to load variables from
/.env

This will also be useful when we need secrets or config for
CircuitPython outside of the VM (like WiFi credentials.)

Fixes #4212
2022-05-18 14:01:35 -07:00
Dan Halbert
4487f61404 Restore automatic gc_collect() after an import 2022-05-18 11:37:13 -04:00
Jeff Epler
016242aa26
Get rid of a memset() for the case where finalisers are enabled
This saves 24 bytes of flash on trinket m0
2022-05-14 06:37:18 -05:00
Scott Shawcroft
269d51d023
Add two stage reset for BLE
This lets the BLE stack run through the wait period after a VM run
when it may be waiting for more writes due to an auto-reload.

User BLE functionality will have their events stopped. Scanning and
advertising is also stopped.
2022-05-12 13:20:44 -07:00
Dan Halbert
58646a936e Correct errno messages 2022-05-10 14:01:30 -04:00
Jeff Epler
510890b207
Enable squeezing property storage in flash
.. and enable it on atmel-samd and raspberrypi. On trinket_m0 this saves
96 net bytes of flash. There are 216 bytes actually saved by reducing
the flash storage size of the property descriptors, but added code in
several paths takes back over half of the 'raw savings'.

By organizing the "get-only" and "get-set" (but no delete) properties
each in a different section, we can represent then more efficiently.

Testing performed: that a get-only property can still be gotten but
can't be set or deleted; that a get-set property can sill be gotten or
set but can't be deleted.  Tested on pygamer.

Because this requires linker file support, I only enabled it on two of
the ports.
2022-05-03 08:48:53 -05:00
Jeff Epler
78cf0a90af
Make MP_PROPERTY_GETTER / _GETSET fully declare the property
This will enable setting data attributes, namely, the section of the
symbol.
2022-05-03 08:48:53 -05:00
Jeff Epler
5b9f0681ad
Get some getter props defined through another macro 2022-05-03 08:48:53 -05:00
Jeff Epler
31da335cac
Introduce, use MP_PROPERTY_GETTER, _GETSET
Later, these can be changed in cunning ways to save flash storage.
2022-05-03 08:48:52 -05:00
Dan Halbert
3a8fb4e956
Merge pull request #5852 from jepler/floppy
Add floppyio
2022-04-26 11:40:19 -04:00
Dan Halbert
4aea8049c5
Merge pull request #6279 from mjs513/main
Added Settable Clock for MIMXRT BOARDS
2022-04-20 08:31:41 -04:00
George White
32fc084b39 Removed compiler flag in favor of MP_WEAK implementation 2022-04-18 13:10:12 +00:00
George White
f502703e52 Add hook to do some flash setup before filesystem init 2022-04-18 13:10:12 +00:00
mjs513
fd41c1ac5b Update based on PR Comments 2022-04-14 06:45:16 -04:00
lady ada
1f3dadcbb9 ok other waythen 2022-04-08 16:43:15 -04:00
lady ada
ea3dfa444a msys at least breaks elsewhere now 2022-04-08 16:39:47 -04:00
Jeff Epler
f7be4345d9
Merge remote-tracking branch 'origin/main' into floppy 2022-04-07 08:37:46 -05:00
Dan Halbert
2693a4cfe1
Merge pull request #6069 from gamblor21/uzlib-module
zlib Module
2022-04-06 12:06:44 -04:00
Jeff Epler
fe98248a3d
Merge remote-tracking branch 'origin/7.2.x' into merge-7.2.x 2022-04-05 08:45:13 -05:00
Jeff Epler
e0827eb52a
Merge pull request #6238 from dhalbert/ringbuf-free-fix
Free ringbuf buffer by relying on gc, not gc_free()
2022-04-05 08:43:36 -05:00
Dan Halbert
b29b7bfe32 Free ringbuf buffer by relying on gc, not gc_free() 2022-04-04 20:34:49 -04:00
Damien George
a43cfdd274
py/vm: Prevent array bound warning when using -MP_OBJ_ITER_BUF_NSLOTS.
This warning can happen on clang 13.0.1 building mpy-cross:

../py/vm.c:748:25: error: array index -3 refers past the last possible
  element for an array in 64-bit address space containing 64-bit (8-byte)
  elements (max possible 2305843009213693952 elements)
  [-Werror,-Warray-bounds]
                        sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL;
                        ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using pointer access instead of array access works around this warning.

Fixes issue #8467.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-04 09:22:30 -05:00
Mark
8ed7b114cd
Merge branch 'main' into uzlib-module 2022-04-03 11:48:37 -05:00
gamblor21
f9d7f46d67 Removing DecompIO 2022-03-23 17:02:58 -05:00
Jeff Epler
e9d81c2826
Add mdns module
This allows for CircuitPython to resolve a .local domain and find
other devices with MDNS services.

First step for #6174
2022-03-17 18:16:16 -07:00
Dan Halbert
bad6cdcfa5
Merge pull request #6160 from tannewt/merge_7.2.2
Merge 7.2.2 changes into main
2022-03-17 20:02:30 -04:00
Nicolas Favre-Felix
6573981350
Explicitly ignore unused variables (fixes #6158)
A macro in py/bc.h declares five variables that are used to hold data
temporarily, without their values being used after the assignments. This
causes "unused-but-set-variable" warnings in clang 13. We mark these
variables as explicitly ignored to avoid this new warning.
2022-03-15 22:33:10 -07:00
Scott Shawcroft
dcc3ec171e
Merge remote-tracking branch 'adafruit/7.2.x' into merge_7.2.2 2022-03-15 13:56:11 -07:00
Dan Halbert
f13d218749
Merge pull request #6125 from tannewt/usb_host
Start of USB host API
2022-03-11 21:41:28 -05:00
Scott Shawcroft
7cb66dd316
Merge pull request #6142 from dhalbert/7.2.x-autoreload-fake-sleep
7.2.x autoreload rework (again)
2022-03-11 16:46:04 -08:00
Dan Halbert
e4cd9690f1 rework auto-reload delay logic 2022-03-11 14:03:04 -05:00
Scott Shawcroft
00dcf6bd03
Tweaks from review 2022-03-11 10:51:50 -08:00
Dan Halbert
f59f8acf78 implement: from __future__ import annotations 2022-03-10 11:19:35 -05:00
Dan Halbert
05a4d24a0f
Merge pull request #6117 from dhalbert/__future__
implement `from __future__ import annotations`
2022-03-08 09:33:36 -05:00
Scott Shawcroft
83593a1558
Start of USB host API
This allows you to list and explore connected USB devices. It
only stubs out the methods to communicate to endpoints. That will
come in a follow up once TinyUSB has it. (It's in progress.)

Related to #5986
2022-03-07 18:07:25 -08:00
Radomir Dopieralski
93ea1bd9bd Add a flag for removing the Blinka logo from the REPL
There may be several reasons why we might want to remove the logo form
the REPL: a fork of CircuitPython that doesn't have the right to use the
logo, an especially small display that needs all the room it has to be
useful, displays that are especially vulnerable to burn-in, maybe even
the smaller chips where we want to save as much flash memory as
possible.
2022-03-05 15:38:59 +01:00
Dan Halbert
1164f2b081 implement: from __future__ import annotations 2022-03-04 14:16:40 -05:00
Dan Halbert
fc8aae0540 clean up py/objmodule.c for circuitpython 2022-02-24 15:33:12 -05:00
Tsutomu IKEGAMI
4c06915c47 Rename _uasyncio to _asyncio.
Register _asyncio module in CP manner.
2022-02-23 18:44:55 +09:00
Tsutomu IKEGAMI
0929353e5c Merge branch 'main' into enable_uasyncio 2022-02-22 16:53:10 +09:00
gamblor21
664e02535b Renaming and documentation 2022-02-20 15:32:44 -06:00
gamblor21
ba229f1007 Initial commit of uzlib module 2022-02-19 10:41:42 -06:00
Jeff Epler
ff4d4f791b
Make sure ULAB_HAS_USER_MODULE is defined (as zero)
This fixes a problem preprocessing genhdr/moduledefs.h, which refers to it.

This file doesn't include the place that ulab normally defines
ULAB_HAS_USER_MODULE by default, so just force it.
2022-02-19 10:29:17 -06:00
Jeff Epler
090b153b3e
Fix build of dynmod with armv7m (lacks floating point) 2022-02-18 08:45:50 -06:00
Jeff Epler
684faab110
Enable the "lookup cache" for FULL_BUILDs
.. and remove a stanza for the "cache map lookup in bytecode" option,
which has been removed by upstream in 1.18; it's superceded by these
other improvements.
2022-02-18 08:32:39 -06:00
Jeff Epler
f45a6d762f
Merge remote-tracking branch 'origin/main' into merge-1.18 2022-02-18 08:12:05 -06:00
Dan Halbert
28714963d5 don't wait for USB or BLE workflow after true deep sleep 2022-02-17 15:41:55 -05:00
Jeff Epler
2b32dce256
genlast: Actually catch errors when preprocessing files
Due to a number of problems, an error calling the preprocessor wasn't
making the whole genlast process fail.

Now, after an execption during preprocess is printed, it is re-raised.
Then, by actually collating the results of executor.map, the exception
will be raised in the main thread context. Any CalledProcessError is simply
converted to a nonzero exit status.
2022-02-17 08:36:29 -06:00
Jeff Epler
4f47a5e61c
Adapt from our FROZEN_MPY_DIRS to manifests, incuding preprocessing 2022-02-16 15:34:00 -06:00
Jeff Epler
4c9d14b73f Merge remote-tracking branch 'origin/main' into merge-1.18 2022-02-16 11:43:53 -06:00
Tsutomu IKEGAMI
b0b3c7817f Fix ticks in moduasyncio.c to work with adafruit version of asyncio, and enable _uasyncio module. 2022-02-16 19:22:18 +09:00
Jeff Epler
c4ae8c8320
Merge pull request #6028 from jepler/fix-test-natmod
Fix all natmod tests to run on x64
2022-02-15 20:52:36 -06:00