Commit Graph

1896 Commits

Author SHA1 Message Date
Dan Halbert e0e3224253 forgot a check for BOARD_HAS_CRYSTAL 2021-12-07 15:42:31 -05:00
Dan Halbert 7e21344cf0 fix FrequencyIn for crystalless boards and simplify clock logic 2021-12-07 13:12:24 -05:00
Dan Halbert 92bb909bf0 add a frequencyin_reset() for VM restart 2021-12-05 17:06:42 -05:00
Dan Halbert e8ea9c75a1 check for missing pins; deinit txrx leds 2021-11-30 19:16:21 -05:00
Dan Halbert 57c33059f3 board_deinit() everywhere 2021-11-30 11:00:10 -05:00
Dan Halbert 95c09ac66f
Merge pull request #5610 from tannewt/rpi
Initial broadcom port for Raspberry Pi
2021-11-24 19:02:23 -05:00
Scott Shawcroft e6a68cc4a7
Shrink 3 SAMD builds by disabling onewireio 2021-11-24 14:27:49 -08:00
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Dan Halbert 582a923ec9
Merge pull request #5579 from jepler/fix-optimization-same54
same54: Use the same optimization as other sam d5x/e5x
2021-11-16 08:32:08 -05:00
Dan Halbert 73430af78b
-O2 without -fno-inline-functions 2021-11-15 22:36:23 -05:00
Jeff Epler 1039e1116b
same54: Use the same optimization as other sam d5x/e5x
It's likely that this is a relic of my early testing.
2021-11-12 18:54:56 -06:00
Jeff Epler dfef5014ed
enable rainbowio with newly free space 2021-11-12 17:31:12 -06:00
microDev b5dd8891e2
turn off `onewireio` on `feather_m0_adalogger` 2021-11-12 20:02:22 +05:30
Dan Halbert adac5ee596
Merge pull request #5563 from jepler/enable-error-missing-prototypes
Additional missing-prototypes fixes
2021-11-11 11:57:43 -05:00
Jeff Epler cd6599ce65
A few more missing-prototypes fixes 2021-11-11 08:42:30 -06:00
Dan Halbert f058c5ec8c fix kicksat-sprite 2021-11-10 23:05:06 -05:00
Jeff Epler 340d6b9213
more missing-prototypes fixes 2021-11-10 21:00:17 -06:00
Dan Halbert e7d9dc323b shrink kicksat-sprite, simmel, pyb_nano_v2 2021-11-10 21:12:41 -05:00
Dan Halbert 58485bc0b1 Switch SAMD51 and SAME51 back to -Os from -O2
The SAMx51 builds were getting very close to full on larger translations. This PR
adds 1400 bytes of enabled features, and pushed some over the edge.
2021-11-10 16:00:38 -05:00
Jeff Epler ebc8359c67
disable missing-prototypes diagnostics in yet another tinyusb file 2021-11-10 12:47:55 -06:00
Jeff Epler 5cba23e04d
More missing-prototypes fixes 2021-11-10 12:22:07 -06:00
Jeff Epler 621953c960
Additional missing-prototypes fixes
I think this correctly enables missing-prototypes in atmel-samd
and raspberrypi ports.
2021-11-10 10:55:53 -06:00
Dan Halbert a69496b0e7
Merge pull request #5562 from microDev1/traceback
Refactor traceback handling
2021-11-10 11:53:35 -05:00
microDev 53a68f7ce6
turn off `onewireio` on `arduino_nano_33_iot` 2021-11-10 20:25:46 +05:30
Jeff Epler 63fbf98186
Enable -Wmissing-prototypes for atmel-samd 2021-11-09 20:05:00 -06:00
Scott Shawcroft bb71f8c9b3
Merge pull request #5544 from jepler/alphablend
bitmaptools: add alphablend
2021-11-08 10:50:03 -08:00
Jeff Epler 6790f95953 Fix disabling of FRAMEBUFFERIO on atmel-samd
.. this needs to imply the disabling of RGBMATRIX too
2021-11-05 15:19:01 -05:00
Jeff Epler 43b593725b atmel-samd: Fix converting watchdog seconds to cycles
It's intended that the actual timeout always be at least the requested
timeout.  However, due to multiplying by the wrong factor to get from
seconds to cycles, a timeout request of e.g., 8.1s (which is less than
8.192s) would give an actual timeout of 8, not 16 as it should.
2021-11-05 11:40:08 -05:00
Jeff Epler 8e8c44afea Merge remote-tracking branch 'origin/main' into alphablend 2021-11-05 11:24:51 -05:00
Jeff Epler d532ad388b disable framebufferio so bitmaptools can fit 2021-11-05 11:24:03 -05:00
Jeff Epler 334a9c85ce Merge remote-tracking branch 'origin/main' into gifio 2021-11-04 20:22:00 -05:00
Jeff Epler a8614a61dc ParallelImageCapture: Add continuous capture on espressif
By having a pair of buffers, the capture hardware can fill one buffer while
Python code (including displayio, etc) operates on the other buffer.  This
increases the responsiveness of camera-using code.

On the Kaluga it makes the following improvements:
 * 320x240 viewfinder at 30fps instead of 15fps using directio
 * 240x240 animated gif capture at 10fps instead of 7.5fps

As discussed at length on Discord, the "usual end user" code will look like
this:

    camera = ...

    with camera.continuous_capture(buffer1, buffer2) as capture:
        for frame in capture:
            # Do something with frame

However, rather than presenting a context manager, the core code consists of
three new functions to start & stop continuous capture, and to get the next
frame.  The reason is twofold.  First, it's simply easier to implement the
context manager object in pure Python.  Second, for more advanced usage, the
context manager may be too limiting, and it's easier to iterate on the right
design in Python code.  In particular, I noticed that adapting the
JPEG-capturing programs to use continuous capture mode needed a change in
program structure.

The camera app was structured as
```python
while True:
    if shutter button was just pressed:
        capture a jpeg frame
    else:
        update the viewfinder
```

However, "capture a jpeg frame" needs to (A) switch the camera settings and (B)
capture into a different, larger buffer then (C) return to the earlier
settings. This can't be done during continuous capture mode. So just
restructuring it as follows isn't going to work:

```python
with camera.continuous_capture(buffer1, buffer2) as capture:
    for frame in capture:
        if shutter button was just pressed:
            capture a jpeg frame, without disturbing continuous capture mode
        else:
            update the viewfinder
```

The continuous mode is only implemented in the espressif port; others
will throw an exception if the associated methods are invoked.  It's not
impossible to implement there, just not a priority, since these micros don't
have enough RAM for two framebuffer copies at any resonable sizes.

The capture code, including single-shot capture, now take mp_obj_t in the
common-hal layer, instead of a buffer & length.  This was done for the
continuous capture mode because it has to identify & return to the user the
proper Python object representing the original buffer.  In the Espressif port,
it was convenient to implement single capture in terms of a multi-capture,
which is why I changed the singleshot routine's signature too.
2021-11-03 11:02:46 -05:00
Jeff Epler 18eaee9beb reenable RAINBOWIO on these boards 2021-11-01 12:52:13 -05:00
Jeff Epler 3e020a73a8 Disable gifio if no displayio & for small boards
Technically all gifio needs from displayio is the definition of
colorspaces, but let's just disable it for now.
2021-10-26 08:54:18 -05:00
Jeff Epler 8c7760b1a6 don't include gifio on samd21 boards 2021-10-26 08:54:18 -05:00
Dan Halbert e868f1b1fe
Merge pull request #5510 from jepler/cmd25-v2
sdcardio: Use CMD25 across multiple writeblocks() calls
2021-10-26 08:46:28 -04:00
Scott Shawcroft 5315348b11
Merge pull request #5425 from maholli/samd-sleep
functioning samd deep sleep ('alarm.time' & 'alarm.pin')
2021-10-25 14:42:12 -07:00
Jeff Epler d999a88e57 Drop Adafruit_CircuitPython_SD where sdcardio is enabled 2021-10-25 16:07:27 -05:00
Max Holliday 339cf5ecf9 staying caught up with runtime changes 2021-10-24 15:49:14 -07:00
Max Holliday adbff053ce fix QSPI_SINGLE pin definitions 2021-10-24 12:37:30 -07:00
Max Holliday 943f2b2085 remove interrupt_char.h 2021-10-23 09:01:40 -07:00
Max Holliday 397b2f6bb5 pin alarm configures pins again before deep sleep 2021-10-21 10:03:46 -07:00
Max Holliday e74a8e38fe
Merge branch 'adafruit:main' into samd-sleep 2021-10-21 09:52:55 -07:00
Scott Shawcroft cf4597c6db
Merge pull request #5484 from dhalbert/samd21-pdmin-fix
fix SAMD21 PDMIn DMA event use
2021-10-20 09:47:13 -07:00
Dan Halbert fc440e7609 move sercom_reset() etc. out of busio/SPI.c to busio/__init__.c 2021-10-19 15:18:32 -04:00
Jeff Epler 39795430a4
Apply suggestions from code review
Eliminates the "pet" function

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-10-19 13:25:28 -05:00
Dan Halbert 79ee78e690 fix SAMD21 PDMIn DMA event use 2021-10-19 13:18:14 -04:00
Jeff Epler d38cf05e59 samd51: Add watchdog timer 2021-10-19 10:52:14 -05:00
Jeff Epler 9eebb3dbab rotaryio: Add the ability to set the divisor
At present, Adafruit's rotary encoders all move 1 quadrature cycle per
detent, so we originally hard-coded division-by-4.  However, other
encoders exist, including ones without detents, ones with 2 detents per
cycle, and others with 4 detents per cycle.

The new `divisor` property and constructor argument allows selecting
a divisor of 1, 2, or 4; with the default of 4 giving backward
compatibility.

The property is not supported (yet?) on espressif MCUs; it throws an
error if a value other than 4 is set.
2021-10-16 09:43:45 -05:00
Jeff Epler 414c2f9da6 Always use python3
.. similar to https://github.com/micropython/micropython/pull/4448
2021-10-15 15:11:21 -05:00