Commit Graph

162 Commits

Author SHA1 Message Date
Scott Shawcroft
061d3a16ff
Merge pull request #4911 from DavePutz/issue_4908
Fix for issue #4908 - pulseout leaving line high
2021-06-24 15:32:48 -07:00
Dan Halbert
836db4e4a1
Merge pull request #4816 from hierophect/rp2040-alarms
RP2040: add Alarm module
2021-06-24 08:15:57 -04:00
root
ab1d7429f1 Fix for issue #4908 - pulseout leaving line high 2021-06-23 21:09:27 -05:00
Lucian Copeland
1f3d69d87c Clean up sleep memory, mark as not-implemented 2021-06-20 17:57:51 -04:00
Jeff Epler
268717e427 ParallelImageCapture: Switch to taking a list of pins
.. adopting validate_pins from RGBMatrix into shared-bindings

.. updating other platforms for API change
2021-06-10 11:15:18 -05:00
Lucian Copeland
63c1791d87 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-06-07 14:11:41 -04:00
Scott Shawcroft
bc014cecb5
Merge pull request #4859 from DavePutz/hcsr04_fix
Fix pulsein pause and resume functions to handle HCSR04
2021-06-04 13:26:05 -07:00
root
57334c812e Fix pulsein pause and resume functions to handle HCSR04 2021-06-04 12:10:41 -05:00
root
8761e4bfd7 Initialize pacing timer 2021-05-30 12:12:38 -05:00
root
a2b220370e Fix formatting issue 2021-05-29 12:26:41 -05:00
root
760e8c77bd Changes to correct repeat playing on a channel 2021-05-29 11:55:10 -05:00
Lucian Copeland
feff243e8f Add RTC deep sleep alarm support 2021-05-28 13:52:05 -04:00
Lucian Copeland
24041f34b0 Merge remote-tracking branch 'upstream/main' into rp2040-alarms 2021-05-27 18:40:40 -04:00
Lucian Copeland
8e1892ac6f Implement RP2040 Alarm module
Adds light and deep sleep functionality for the TimeAlarm and PinAlarm
alarm categories. Adds board deinit for all platforms.
2021-05-27 18:33:29 -04:00
root
24e641a834 Fix for Issue #4266 2021-05-25 16:06:00 -05:00
Scott Shawcroft
5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
root
9393467819 Update comment for spelling 2021-05-17 22:13:00 -05:00
root
ff4b1b28d2 iFormatting fixes 2021-05-17 16:43:55 -05:00
root
11ef36d09d Implement pulseout for RP2040 2021-05-17 16:24:45 -05:00
Scott Shawcroft
1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Jeff Epler
da19e8e2d7 Merge remote-tracking branch 'origin/main' into fix-codeformat-subdirs 2021-04-30 15:31:08 -05:00
Jeff Epler
e95e921ca1 codeformat: Fix filename matching
In #4683, tannewt noticed that uncrustify was not running on some
file in common-hal.

I investigated and found that it was not being run on a bunch of paths.

Rather than make incremental changes, I rewrote list_files to work
bsaed on regular expressions; these regular expressions are created from
the same git-style glob patterns.

I spot-checked some specific filenames after this change, and all looks good:

```
$ python3 tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py  ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
tools/codeformat.py -v --dry-run tests/basics/int_small.py ports/raspberrypi/common-hal/pulseio/PulseIn.c extmod/virtpin.c tests/thread/thread_exit1.py ports/raspberrypi/background.h extmod/re1.5/recursiveloop.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup extmod/virtpin.c ports/raspberrypi/background.h ports/raspberrypi/common-hal/pulseio/PulseIn.c
black --fast --line-length=99 -v tests/thread/thread_exit1.py
```
recursiveloop and int_small are excluded, while PulseIn, virtpin,
and background are included.

Testing running from a subdirectory (not _specifically_ supported though):
```
(cd ports && python3 ../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c)
../tools/codeformat.py -v --dry-run raspberrypi/common-hal/pulseio/PulseIn.c ../extmod/virtpin.c
uncrustify -c /home/jepler/src/circuitpython/tools/uncrustify.cfg -lC --no-backup ../extmod/virtpin.c raspberrypi/common-hal/pulseio/PulseIn.
```

As a side-effect, a bunch more files are re-formatted now. :-P
2021-04-30 10:48:08 -05:00
DavePutz
1ec59cd534
Fix up indentation 2021-04-29 12:38:13 -05:00
root
cfac07c1cc Wrap pulsein when maxlen is exceeded 2021-04-28 11:20:13 -05:00
Scott Shawcroft
f99deeda68
Merge pull request #4668 from DavePutz/issue_4659
Increased possible pulsein length to ~65 ms.
2021-04-27 11:01:51 -07:00
root
91739de71a Increased max pulse to 65535 us 2021-04-26 18:52:15 -05:00
root
5bd1da21a2 Increased possible pulsein length to 32 ms. 2021-04-25 21:38:57 -05:00
Jeff Epler
92919c25c2
Merge pull request #4666 from DavePutz/issue_4660
Reset buffer index in PulseIn clear
2021-04-25 20:33:58 -05:00
root
d1861a6b9c Reset buffer index in PulseIn clear 2021-04-25 14:24:21 -05:00
gamblor21
30f31639d3 Added statemachine deinit 2021-04-25 11:58:22 -05:00
Dan Halbert
80f05c76a8
Merge pull request #4654 from dhalbert/6.2.x-merge-1
Port #4645 to main
2021-04-24 10:29:52 -04:00
Dan Halbert
454e78f41f merge #4645 from 6.2.x to main 2021-04-23 13:33:58 -04:00
Jeff Epler
f838ff9528 raspberrypi: Remove debug prints 2021-04-23 09:44:01 -05:00
Jeff Epler
10fee3e673 raspberrypi: Increase PIO clock speed in ParallelImageCapture
.. this allows DIV_4 and DIV_2 resolutions to work without being
jumbled.
2021-04-22 12:14:44 -05:00
Jeff Epler
2def016fd0 raspberrypi: Use 32-bit elements in FIFO
.. these do come in the right
2021-04-22 12:14:03 -05:00
Jeff Epler
7fb751808f raspberrypi: Implement ParallelImageCapture using PIO
.. based on code from Phil B.
2021-04-22 12:02:51 -05:00
Dan Halbert
b3ffb3ab1f Return bytes written from RP2040 UART.write() 2021-04-21 18:38:35 -04:00
Dan Halbert
61e33a5619 fix nrf ISR; make direction consistent across ports; save code size 2021-04-09 11:07:47 -04:00
Jeff Epler
3ce0b512f8 rasberrypi: IncrementalEncoder: factor out state machine 2021-04-08 16:25:47 -05:00
Jeff Epler
1a2ce27b73 raspberrypi: Drop support for auto-reversing swapped encoder 2021-04-06 09:22:59 -05:00
Jeff Epler
fc86475de5 IncrementalEncoder: support swapped pins
Closes: #4422
2021-04-04 13:49:50 -05:00
Jeff Epler
93d6ceedd9 IncrementalEncoder: Disconnect interrupt handler during deinit.
Closes: #4557
2021-04-04 13:49:41 -05:00
Jeff Epler
bcd90dd927 IncrementalEncoder: There are no out pins.
Closes #4556
2021-04-04 13:49:21 -05:00
Phil Howard
b8d4f9655f RP2040: Only bitbang 0-byte writes
The I2C.c for RP2040 included a special case for writes <=2 bytes to match the MicroPython implementation,
however RP2040 does support 1 and 2 byte reads, with only 0 bytes being the exception.

Signed-off-by: Philip Howard <phil@pimoroni.com>
2021-03-17 16:25:54 +00:00
gamblor21
3b01a65743 Fixed formatting 2021-03-16 08:14:49 -05:00
Mark
e326d7ca80
Merge branch 'main' into rp_dp_parallel 2021-03-15 20:00:13 -05:00
Scott Shawcroft
f7a988b9b3
Merge pull request #4405 from DavePutz/issue_4237
Issue 4237 - Changed initial setting in program_struct
2021-03-15 17:51:36 -07:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
root
9a83501982 Fixed initial settings for program_struct to allow more than 1 program per pio 2021-03-14 15:05:56 -05:00
Scott Shawcroft
1b106de4e0
Merge pull request #4262 from DavePutz/issue_4111
Issue 4111 - Implement pulseio(pulsein) for RP2040
2021-03-12 16:48:57 -08:00