Commit Graph

742 Commits

Author SHA1 Message Date
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