Commit Graph

340 Commits

Author SHA1 Message Date
jposada202020
be90fa80e8 Initial Changes 2021-03-09 10:48:33 -05:00
Jeff Epler
1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Jeff Epler
ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
Dan Halbert
f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00
Dan Halbert
3a68ac8abb
Merge pull request #3536 from pewpew-game/pew-get-ticks
Fix #3504: Don't use time module in pew.tick()
2021-02-08 17:50:44 -05:00
BiffoBear
2656c84b01 Initial commit. Edited error messages in .c files 2021-02-03 05:49:40 +07:00
Dan Halbert
4be5e914ac
Merge pull request #3966 from dhalbert/samd-dac-channels
fix atmel-samd DAC channel selection logic
2021-01-12 13:01:50 -05:00
Dan Halbert
452d66dd0e
Update ports/atmel-samd/common-hal/analogio/AnalogOut.c
whoops, yes!

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-01-11 19:12:52 -05:00
Dan Halbert
316bd0c72d fix atmel-samd DAC channel selection logic 2021-01-10 19:22:15 -05:00
Dan Halbert
908e02439d Look up TCC resolution as necessary 2021-01-09 15:04:23 -05:00
microDev
dc332baa87
update common_hal_reset_pin() 2020-12-28 20:04:00 +05:30
Uwe Gartmann
2729666d82
SAMD51: change of DAC power setting
Fixes wrong DAC output levels at high data rate
closes adafruit#3796
2020-12-25 17:53:43 +01:00
Scott Shawcroft
eb65765d52
Merge pull request #3867 from dhalbert/frequencyin-fix-6.0.x
FrequencyIn: do not raise in interrupt handler
2020-12-23 12:14:16 -08:00
Dan Halbert
89079039ad FrequencyIn: do not raise in interrupt handler 2020-12-22 18:54:42 -05:00
Scott Shawcroft
40118bcf57
Add board_deinit for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
Dan Halbert
8b7c23c1ee address review comments 2020-12-01 20:01:14 -05:00
Dan Halbert
104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
Dan Halbert
ef0830bfe2 merge from upstream + wip 2020-11-25 17:52:06 -05:00
Dan Halbert
a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert
75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
Jeff Epler
aaca3eccf1 samd: PDMIn: Reduce code unrolling on samd21 only
Instead of unrolling the code 16 times, unroll it 4 times and loop
over it 4 times.  This gives the same 16 iterations, but at an expense
of less flash space.
2020-11-19 16:19:37 -06:00
Dan Halbert
ffff02c053 Merge remote-tracking branch 'adafruit/main' into sleep 2020-11-16 12:06:11 -05:00
Scott Shawcroft
bda3267432
Save flash space
* No weak link for modules. It only impacts _os and _time and is
  already disabled for non-full builds.
* Turn off PA00 and PA01 because they are the crystal on the Metro
  M0 Express.
* Change ejected default to false to move it to BSS. It is set on
  USB connection anyway.
* Set sinc_filter to const. Doesn't help flash but keeps it out of
  RAM.
2020-11-13 18:57:52 -08:00
Scott Shawcroft
68eb809fbf
Update parallel bus signatures 2020-11-13 18:57:52 -08:00
microDev
930cf14dce
Add check for invalid io, function to disable all alarms 2020-10-27 16:17:26 -07:00
microDev
e35938971a
Add description of alarm modules 2020-10-27 16:16:55 -07:00
Jeff Epler
fb768dfc14 samd: AnalogOut: Better handle boards which IGNOREd analog pins 2020-10-17 20:08:32 -05:00
Jeff Epler
eb0b023dee samd: extend IGNORE_PIN_foo to all sam e5x/e5x pins 2020-10-17 20:08:32 -05:00
Jeff Epler
aa3c890ead samd: pin: Fix 'undefined reference to pin_PA30'
.. when PA30 is IGNOREd
2020-10-17 20:08:32 -05:00
Scott Shawcroft
379e73af2e
Finer grained, per port tick locking
Fixes #3504 hopefully.
2020-10-12 18:43:21 -07:00
Radomir Dopieralski
3f6ca7bd32 Make end-of-line-fixer happy 2020-10-10 23:59:44 +02:00
Radomir Dopieralski
b227b79dec Fix #3504: Don't use time module in pew.tick()
The time.sleep() and time.monotonic() functions break the timer
interrupt on which PewPew10 display relies, so we can't use them
anymore. Instead I'm adding a time-keeping function to the display
code itself, which then can be used in pew.tick() internally.
2020-10-10 20:26:33 +02:00
Jeff Epler
16ed875f4e canio: remove unused fields
these relate to properties that were removed as well
2020-10-06 20:14:50 -05:00
Jeff Epler
611f81ac1a canio: actually drop the _error_count properties
thanks @tannewt
2020-09-29 14:25:53 -05:00
Jeff Epler
f4e36fc7f6 CAN: Use mp_obj_t insteaed of canio_message_obj_t, get rid of rtr field 2020-09-28 17:22:00 -05:00
Jeff Epler
3e97e9c4be canio: Listener: shuffle function declarations around 2020-09-28 17:22:00 -05:00
Jeff Epler
48bda589b8 Listerner: read -> receive, drop readinto
This prepares for creating a separate RemoteTransmissionRequest class
2020-09-28 17:22:00 -05:00
Jeff Epler
79ca430ddf Match: address -> id 2020-09-28 17:22:00 -05:00
Jeff Epler
59580d0f2d canio: Fix implementation bugs in atmel-sam 2020-09-22 09:36:29 -05:00
Jeff Epler
4869dbdc67 canio: rename from _canio
This reflects our belief that the API is stable enough to avoid incompatible changes during 6.x.
2020-09-21 16:44:26 -05:00
Jeff Epler
9e8f1820c8 canio.CAN: switch rx/tx, make both mandatory, move declarations around 2020-09-21 16:44:26 -05:00
Jeff Epler
7fd6cab2ac canio: Make both tx and rx (but not both) optional
.. loopback and silent come from the (optional) constructor parameters
not guessing based on the pin specification

.. docstring & comment improvements
2020-09-21 16:44:26 -05:00
Jeff Epler
44c5b2bbb1 Respond to review comments
Thanks @tannewt!
2020-09-21 16:44:26 -05:00
Jeff Epler
58b920ed97 fix whitespace 2020-09-21 16:44:26 -05:00
Jeff Epler
27cbb690e5 _canio: Add listener matching
Lightly tested:
 * no matches (catch-all)
 * standard address single address matches (even and odd positions)
 * standard address mask matches
 * only tested that extended doesn't match non-extended
2020-09-21 16:44:26 -05:00
Jeff Epler
635fcadb59 _canio.CAN: add error handling & bus state 2020-09-21 16:44:26 -05:00
Jeff Epler
a2e1867f69 _canio: Minimal implementation for SAM E5x MCUs
Tested & working:

 * Send standard packets
 * Receive standard packets (1 FIFO, no filter)

Interoperation between SAM E54 Xplained running this tree and
MicroPython running on STM32F405 Feather with an external
transceiver was also tested.

Many other aspects of a full implementation are not yet present,
such as error detection and recovery.
2020-09-21 16:44:26 -05:00
Jeff Epler
183649aad8 samd: move mcu_find_pin_function to header
.. it'll be used in can as well as sdio
2020-09-21 16:44:07 -05:00
Dan Halbert
5116375604
Merge pull request #3436 from jepler/fix-spi-sercom4
samd: SPI: improve conditional code
2020-09-18 19:14:39 -04:00
Dan Halbert
23dd7c7c96
Merge pull request #3435 from jepler/fix-sdhc1
sdioio: fix code for the case where there is no SDHC1
2020-09-18 17:10:59 -04:00