Commit Graph

8512 Commits

Author SHA1 Message Date
Dan Halbert 0642917cf7
Merge pull request #6270 from FoamyGuy/tilegrid_bitmap_property
adding bitmap property to TileGrid
2022-04-25 09:09:28 -04:00
Dan Halbert fdf8207e05
Merge pull request #6281 from ViktorWiz/w5100s-evb-pico
Added WIZnet board W5100s-evb-pico
2022-04-25 09:09:08 -04:00
Dan Halbert 5b7e0754dd
Merge pull request #6287 from KurtE/mimxrt_pwm
Fix PWM Support for the MIMXRT boards
2022-04-25 09:02:40 -04:00
Jeff Epler 1a89a2d366
fix doc build 2022-04-23 13:25:59 -05:00
Jeff Epler 989fb828d4
Revamp background writing
Now a 'once' and a 'loop' buffer can be specified.

'once' is useful for things like writing a neopixel strip in the background,
if you can guarantee the buffer contents are stable until the write is complete.

'loop' is useful for periodic things, like pwm & servos.

both together are useful for some special cases of pwm/servo, where a
transitional waveform needs to be played for one repetition and then
a new waveform needs to be played after that.

The API is renamed to reflect that it's a more generic 'background'
operation.
2022-04-23 13:09:36 -05:00
KurtE 8d9dc1fb93
Update ports/mimxrt10xx/supervisor/port.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 11:47:40 -07:00
KurtE 3c343cf1b8
Update ports/mimxrt10xx/supervisor/port.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 11:47:30 -07:00
Dan Halbert 3885bc9018
Merge pull request #6303 from DavePutz/issue_4452
Fix for issue #4452 - time.sleep on STM
2022-04-22 13:34:31 -04:00
KurtE 1312e5c759
Update ports/mimxrt10xx/supervisor/port.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 09:16:27 -07:00
KurtE f102c15bb4
Update ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 09:15:40 -07:00
KurtE 79dd2a6cd5
Update ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
Fix Comment spelling

Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 09:15:29 -07:00
KurtE 53b7caf13c
Update ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-04-22 09:15:01 -07:00
ViktorWiz e8541e866c fix end of file issue 2022-04-22 15:02:50 +09:00
ViktorWiz 28296f98f8 update pid 2022-04-22 14:59:28 +09:00
ViktorWiz f91be019f6
Merge branch 'adafruit:main' into w5100s-evb-pico 2022-04-22 14:52:04 +09:00
root 289aaae954 Fix for issue #4452 - time.sleep on STM 2022-04-21 17:05:44 -05:00
Dan Halbert 76d54ca8ad shrink sparkfun_redboard_turbo 2022-04-21 12:58:46 -04:00
Jeff Epler 457aba79f4
fix doc build 2022-04-20 08:09:38 -05: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
Dan Halbert 1fcc73bc24
Merge pull request #6261 from KurtE/PortSerialHooksIssue
disable on mimxrt10xx (Teensy40 41) Serial port Hooks
2022-04-19 23:04:07 -04:00
Jeff Epler 144eb5dfd4
fix lost DMA IRQ 2022-04-19 16:42:27 -05:00
Jeff Epler ebc426d9e6
Remove debug prints, improve docs 2022-04-19 16:39:04 -05:00
Jeff Epler b128f180ca
switch to single single dma channel, fix some bugs 2022-04-19 16:33:51 -05:00
KurtE 49769cfea4 Convert to use debug rx/tx pins to trigger adding this code
As per review request
2022-04-19 14:02:16 -07:00
Jeff Epler 33d6d55675
the basics work
the sequence has to be a minimum length, 8 entries, but this problem
is not detected. I don't THINK this is an insurmountable problem.
2022-04-19 15:14:50 -05:00
Jeff Epler 33f5598acc
Stub 'continuous write' functionality 2022-04-19 11:35:43 -05:00
Neradoc 17bba7b17d remove Adafruit_CircuitPython_BusDevice from frozen modules, it's built in now 2022-04-19 06:49:11 +02:00
Dan Halbert 6425e937b5
Merge pull request #6289 from stonehippo/samd51_mm_flash
Samd51 mm flash
2022-04-18 18:59:58 -04:00
KurtE eab4867e61 Remove dead replaced code
As requested, I removed the dead code that was replaced
2022-04-18 15:46:36 -07:00
George White 3b5171c4ff Move hook implementation to supervisor 2022-04-18 14:09:36 +00:00
Dan Halbert 4ab3881a82
Merge pull request #6282 from xuhow/elecfreaks_picoed
Elecfreaks picoed
2022-04-18 10:07:17 -04:00
George White 32fc084b39 Removed compiler flag in favor of MP_WEAK implementation 2022-04-18 13:10:12 +00:00
George White 0ba93b20e5 Setup flash pins on Sparkfun SAMD51 Micromod 2022-04-18 13:10:12 +00:00
mjs513 208bfb33aa Deleted Warnings Chanaged ValueError Method 2022-04-17 15:04:16 -04:00
KurtE 02a0939d2e Fix PWM Support for the MIMXRT boards
There were two main issues with the PWM support.

The first is they would fail to work properly if the board goes
into low power mode, when you do things like:     time.sleep(0.25)
Can make partially work with this by turning on the proper flags
in each of the FlexPWMTimer Timers/sub-timers, but this did not
appear to work if for example you have both A and B channels
enabled.

Second main problem is that the code did not work with the X
channel of each timer/sub-timer.  It looks like someone had
earlier started support for this, But was not sufficient.

Needed to bypass the SDK code and get it closer to the PJRC code.

That is we set the PWM_CTRL_FULL_MASK, which then uses  base->SM[submodule].VAL1  to control
when the timer is reset, so it sets up your cycle/frequency.  But then this implies that X channel
which uses 0, 1 has to be handled specially. So for the different channels:
    A - Uses VAL2 to turn on (0) and VAL3=duty to turn off
    B - Uses VAL4 to turn on (0) and VAL5 to turn off
    X - As mentioned above VAL1 turns off, but its set to the timing for freqency. so
        VAL0 turns on, so we set it to VAL1 - duty
2022-04-16 09:00:45 -07:00
mjs513 0b6c451fdf Add Overclocking Warnings to Processor.c 2022-04-16 11:01:50 -04:00
mjs513 fd41c1ac5b Update based on PR Comments 2022-04-14 06:45:16 -04:00
Xu Hao 9c1b44a030 Modify USB VID and PID of the Pico:ed 2022-04-14 17:42:04 +08:00
ViktorWiz b30d2e0889 update w5100s-evb-pico mpconfigboard.h 2022-04-14 14:35:23 +09:00
root 716497c132 corrected pre-commit errors 2022-04-13 12:04:28 -04:00
root 60e330fb0d Added Settable Clock for MIMXRT BOARDS 2022-04-13 09:47:55 -04:00
ZodiusInfuser 8cce2e6406 Updated motor pin names 2022-04-12 15:20:28 +01:00
Xu Hao 71a7ec6f76 Add ELECFREAKS Pico:ed board. 2022-04-12 16:10:02 +08:00
Dan Halbert 7be66a5733
Merge pull request #6265 from KurtE/teensyMM
Add Teensy MicroMod board
2022-04-11 12:31:42 -04:00
KurtE f95a68a37c Rename the board name
Renamed the board both name of directory within boards, but also the
name reported board name: board_id -- sparkfun_teensy_micromod

Adafruit CircuitPython 7.3.0-beta.0-10-g2a3eb49da-dirty on 2022-04-10; SparkFun Teensy MicroMod Processor with IMXRT1062DVL6A
2022-04-10 16:56:51 -07:00
BigTuna94 01cff3c4f8 add MIDI to frozen libs 2022-04-10 14:10:07 -04:00
Limor "Ladyada" Fried df74c681d2
Merge pull request #6273 from KurtE/t4x_board_dir_add_txrx_names
Add to board object other Serial and I2c pin names
2022-04-10 12:08:41 -04:00
foamyguy 948040f1f0 disable onewire instead of displayio on boards without room 2022-04-10 10:00:37 -05:00
KurtE ecf2f1c80c Add to board object other Serial and I2c pin names
While testing out this and the new MicroMod Teensy port, @mjs513
and myself found it desirable to have logical pin names for the
different Serial UART objects.  It is a lot easier and clearer
to use and maintain to do something
like: uart4 = busio.UART(board.TX4, board.RX4)
than have to go look up the pin numbers for each board.
2022-04-10 05:39:43 -07:00
Dan Halbert c3cfbc1259 Force pin 21 high; patch; need to diagnose further 2022-04-09 22:03:16 -04:00
foamyguy 7ad5fa511e disable displayio for some boards 2022-04-09 16:24:06 -05:00
KurtE 7ff0036a26 Fix the pre-check stuff 2022-04-08 15:59:27 -07:00
KurtE 2a3eb49da7 Update the pins.c
I fixed a couple issues in the pin name definitions.

The pin names are sort of Teensy centric in that the priority is given
to the pin names you would use in Arduino like D0, D1, ...

But also added names for the MicroMod names in particular the names
on the front of the ATP carrier board

Also updated manufacturer to be both PJRC and Sparkfun
2022-04-08 07:41:51 -07:00
KurtE 93e9e3ad90 Fix end of line 2022-04-07 15:52:01 -07:00
KurtE 03e0acde94 Trying to cleanup the pre build messages 2022-04-07 14:11:22 -07:00
KurtE 2cb422fb19 Create W25Q128JV.ld
Add flash file needed for Teensy MicroMod,
2022-04-07 12:09:56 -07:00
Jeff Epler 766bf8f671
disable floppyio on kicksat-sprite 2022-04-07 10:57:37 -05:00
Jeff Epler f7be4345d9
Merge remote-tracking branch 'origin/main' into floppy 2022-04-07 08:37:46 -05:00
ZodiusInfuser 769b182da4 Added definition for upcoming Pimoroni motor board 2022-04-07 07:24:55 +01:00
Dan Halbert d5deddcaf5
Merge pull request #6207 from domdfcoding/esp32-rotaryio
Add espressif rotaryio divisor support.
2022-04-06 21:35:02 -04:00
KurtE a74ec22aa4 Start setting up a Teensy MicroMod port
I have done a first pass through the files
this also includes a new VID/PID from sparkfun
2022-04-06 17:58:22 -07:00
KurtE 219ef5e407 disable on mimxrt10xx (Teensy40 41) Serial port Hooks
As mentioned in issue #6241  the commit to setup port hooks is now
    causing all input/output that are to go to the Mu window to also
    go to the LpUart that is defined the port serial.c

    and in this case it goes to lpuart4, which on Teensy 4, 4.1 is
    used on Arduino Serial2.  With this new code this port no longer
    works properly.

    This is one way to solve it, in that there is a #if defined() that
    if not set, all of the code in this file is ignored and the higher
    level supervisor stub versions of these functions will be used, which
    don't interfere with Serial2 and my test sketch works again.

    Note: the PR for Switch to Port Serial Hooks, also changed code in
    other ports.  I have not tried to see how.

    There are other more global fixes for this, in which maybe a higer
    level  #if that disables the code within the top level supervisor.  Or
    could be software controlled

    Again this may not be the final solution, but at least it gets
    Serial2 up and running agin.
2022-04-06 15:58:27 -07:00
Dan Halbert dbb6f5f16c
Merge pull request #6246 from DavePutz/issue_6148
Don't reset GPIO4 on the MagTag (used for voltage monitoring)
2022-04-06 13:22:01 -04:00
Dominic Davis-Foster f297e872d6
Account for divisor when overriding position. 2022-04-06 18:13:59 +01:00
Dan Halbert 2693a4cfe1
Merge pull request #6069 from gamblor21/uzlib-module
zlib Module
2022-04-06 12:06:44 -04:00
Dan Halbert 1a329cfd11
Merge pull request #6029 from jepler/pio-wrap
raspberry: StateMachine: Add support for wrap=, wrap_target=
2022-04-06 11:55:02 -04:00
Dan Halbert 99dc4029dc Espressif: disable pull-up on AnalogIn creation 2022-04-06 11:33:56 -04:00
Pontus Oldberg 286e26edf0 Added support for 4MB flash. 2022-04-06 11:08:22 +02:00
ViktorWiz 76efdfd9a6 initial commit for w5100s-evb-pico 2022-04-06 14:52:28 +09:00
root b993313ac1 Don't reset GPIO4 (used for voltage monitoring) 2022-04-05 11:30:12 -05: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 8cd09b1f0d
Merge pull request #6240 from dhalbert/7.2.x-rp2040-clear-uart-rtic-interrupt
handle clearing both RXIC and RTIC interrupts
2022-04-05 08:43:22 -05:00
Dan Halbert 47d3d0d7f8
Merge pull request #6202 from jepler/issue5985
samd: Don't rely on RTC interrupt
2022-04-05 09:16:40 -04:00
Dan Halbert 4cccc1a036 handle clearing both RXIC and RTIC interrupts 2022-04-04 23:55:08 -04:00
Jeff Epler fa4b4fa639
nrf: Correctly mark PWM unused during reset 2022-04-04 10:08:54 -05:00
Mark 8ed7b114cd
Merge branch 'main' into uzlib-module 2022-04-03 11:48:37 -05:00
gamblor21 9d67e62f4d Removed from small board 2022-04-03 11:47:19 -05:00
gamblor21 7b586e077c Removed from small boards 2022-04-02 12:22:14 -05:00
Tod Kurt 390a473dda add board.DISPLAY since display already set up by CirPy 2022-04-01 15:08:43 -07:00
Dominic Davis-Foster 319ca8560c
Always configure the second PCNT channel. 2022-03-31 20:00:34 +01:00
Dan Halbert d9418fb7a3
Merge pull request #6184 from PontusO/main
Added Challenger 840 board.
2022-03-30 21:18:43 -04:00
Dan Halbert ec5c9507b9
Merge pull request #6187 from prplz/espressif-uart-workflow-fixes
Espressif: Fix interrupts in UART workflow
2022-03-30 21:18:02 -04:00
Dan Halbert 6fd968fc12
Merge pull request #6199 from erongd/muselab-wrover-spiram-fix
enable SPIRAM support on muselab nanoESP32S2 board
2022-03-30 21:14:59 -04:00
Dan Halbert f059f7180c
Merge pull request #6208 from ZodiusInfuser/badger
Improvement to Badger 2040 operation on battery
2022-03-30 13:35:47 -04:00
ZodiusInfuser 336abdfbc7 Switch variable to extern 2022-03-30 17:44:36 +01:00
Pontus Oldberg f2d10237d2
Merge branch 'adafruit:main' into main 2022-03-30 16:43:39 +02:00
BigTuna94 dd933c7d06 add NeoPixel lib to firmware 2022-03-30 09:17:26 -04:00
Dan Halbert b032d42a71 Update ports/espressif/boards/adafruit_feather_esp32s2/pins.c 2022-03-29 12:46:58 -04:00
lady ada 2563c509f7 fix automatic i2c enablement with rev C 2022-03-29 12:46:51 -04:00
ZodiusInfuser f07cfdd80c Linting fixes 2022-03-28 18:34:39 +01:00
Dan Halbert c6bfe54dc8
Merge pull request #6209 from ZodiusInfuser/servo
Pin rename on Servo2040 to match schematic and C++/MP board defs
2022-03-28 13:29:27 -04:00
ZodiusInfuser c2fb44b36c Set enable pin to high during boot 2022-03-28 15:56:02 +01:00
ZodiusInfuser b44a2a0c8e Updated pin name to match schematic 2022-03-28 14:07:08 +01:00
Dominic Davis-Foster 6d025a239e
Add espressif rotaryio divisor support. 2022-03-28 09:04:02 +01:00
gamblor21 0d3f45bef8 Remove move DecompIO files 2022-03-27 16:18:56 -05:00
Michael Himing f96cd7361d Fix esp32s2 build 2022-03-27 10:09:23 +11:00
Jeff Epler dd73182441
Merge pull request #6190 from tannewt/esp32s3_usb_devkit
Add ESP32-S3-USB-OTG board
2022-03-26 15:05:30 -05:00
Jeff Epler 35aa32bec0
Merge pull request #6193 from tannewt/fix_empty_mdns
Fix MDNS crash on S2
2022-03-26 15:05:17 -05:00
Jeff Epler 372306411a
samd: Don't rely on RTC interrupt
I instrumented RTC_Handler and determined that on SAMD51 it was possible
for the interrupt to be delivered well before the actual overflow of the
RTC COUNT register (e.g., a value as small as 0xffff_fffd could be seen
at the time of overflow)

Rather than depending on the overflow interrupt coming in at the same time
as COUNT overflows (exactly), rely only on observed values of COUNT in
_get_count, overflowing when it wraps around from a high value to a low
one.

With this change, PLUS a second change so that it is possible to warp
the RTC counter close to an overflow and test in 20ms instead of 3 days,
there was no problem detected over 20000+ overflows. Before, a substantial
fraction (much greater than 10%) of overflows failed.

Fixes #5985

Change to common-hal/rtc/RTC.c for time warping (plus make rtc_old_count non-static):
```patch
 void common_hal_rtc_set_calibration(int calibration) {
+
+    common_hal_mcu_disable_interrupts();
+
+        RTC->MODE0.COUNT.reg = 0xffffff00;
+        rtc_old_count = 0;
+        do {
+        while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) { }
+    }
+    while(RTC->MODE0.COUNT.reg < 0xffffff00);
+    common_hal_mcu_enable_interrupts();
+
+    mp_printf(&mp_plat_print, "Warping RTC in calibration setter count=%08x rtc_old_count=%08x\n", RTC->MODE0.COUNT.reg, rtc_old_count);
```

Test program:
```python
import time
from rtc import RTC

i = 0
while True:
    RTC().calibration = 1 # Warps to ~16ms before overflow, with patch to RTC code
    t0 = time.monotonic_ns()
    et = t0 + 20_000_000 # 20ms
    while (t1 := time.monotonic_ns()) < et: pass
    i += 1
    print(f"{i:6d}: duration {t1-t0}")
    if t1-t0 > 200_000_000: break
    print()
```
2022-03-25 14:48:03 -05:00
Michael Himing 686012426d Espressif: Fix interrupts in UART workflow 2022-03-25 16:20:04 +11:00