Commit Graph

8364 Commits

Author SHA1 Message Date
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
Tod Kurt 390a473dda add board.DISPLAY since display already set up by CirPy 2022-04-01 15:08:43 -07: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
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
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
Eric Rong 7ad6fa8df5 enable SPIRAM support on muselab nanoESP32S2 board 2022-03-24 16:46:13 -07:00
Scott Shawcroft fcde108d03
Merge pull request #6194 from jepler/revamp-duplicate-usb-check
Improve the USB vid:pid duplicate checker
2022-03-24 14:57:48 -07:00
Scott Shawcroft ac7977ba75
Merge pull request #6191 from tannewt/esp_3_wire_spi
Fix 3-wire SPI on ESP
2022-03-24 14:51:16 -07:00
Scott Shawcroft 9d4c74a87e
Merge pull request #6197 from ZodiusInfuser/servo
Added board definition for upcoming Pimoroni servo driver.
2022-03-24 14:44:44 -07:00
jerryneedell bcec1e44f0 add status LED to nrf pca10059 dongdle 2022-03-24 15:05:02 -04:00
ZodiusInfuser 8e98be2704 Added additional constants 2022-03-24 18:32:39 +00:00
ZodiusInfuser 9c81ea86e9 Added board definition for upcoming Pimoroni servo driver. 2022-03-24 16:07:04 +00:00
Jeff Epler d91ca7369c
Merge remote-tracking branch 'origin/main' into revamp-duplicate-usb-check 2022-03-24 09:44:41 -05:00
Jeff Epler a07ac72cc5
Improve the USB vid:pid duplicate checker
To me, it made more sense to track which boards go together in a cluster;
when reviewing a request to actually use a duplicate vid/pid, you want
to know what board(s) it is aliasing.

I also revamped the detection of non-USB boards so that a board .mk file
that couldn't be parsed by the code here would raise a problem instead
of just being skipped for the purposes of checking.

There were some lines with comments on the end, and some variation in
capitalization of the IDs. These are all normalized and a (sometimes
unfriendly!) error printed when it's incorrect.

Before this, here were some ways to trick the duplicate vid/pid checker:
```
USB_PID = 0XABCD
USB_PID = 0xAbCd
USB_PID = 0xABCD # harmless comment?
```
None of these things were ever done on purpose.
2022-03-24 09:42:11 -05:00
Scott Shawcroft 8642dc4aa7
Fix MDNS crash on S2
Fixes #6186
2022-03-23 17:17:48 -07:00
Scott Shawcroft 380a7087d4
Fix 3-wire SPI on ESP
Simplifying the checks fixed it.

Fixes #6141
2022-03-23 14:53:46 -07:00
Scott Shawcroft e13d32b832
Add ESP32-S3-USB-OTG board
This board has both types of USB connectors, a display and buttons
to select items on the display. It also has a micro-B connector for
the UART output.
2022-03-23 14:10:26 -07:00
Scott Shawcroft ee4c501936
Merge remote-tracking branch 'adafruit/main' into c3_serial_jtag 2022-03-23 12:17:02 -07:00
Pontus Oldberg c7b28eb2ef
Update ports/nrf/boards/challenger_840/pins.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-03-23 17:14:49 +01:00
Pontus Oldberg d26297ae98
Update ports/nrf/boards/challenger_840/pins.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-03-23 17:14:40 +01:00
Pontus Oldberg 7901850bb8
Update ports/nrf/boards/challenger_840/pins.c
Co-authored-by: Dan Halbert <halbert@halwitz.org>
2022-03-23 17:14:28 +01:00
Scott Shawcroft 2fa182147b
Fix STM non-F4 builds 2022-03-22 23:07:38 -07:00
Scott Shawcroft f5d90fc84f
Switch to port_serial_* hooks
This makes it easier to integrate port specific serial alongside
the common approaches.
2022-03-22 19:40:33 -07:00
Pontus Oldberg 5e09ed611e Added Challenger 840 board. 2022-03-22 21:36:54 +01:00
Neradoc 367e0ea901 Enable rgb status LED on MakerDiary USB Dongle 2022-03-22 20:53:12 +01:00
Scott Shawcroft 110857c12e
Actually turn on serial over Serial/JTAG for QTPy 2022-03-22 11:45:47 -07:00
Scott Shawcroft b8d1bb1d5d
Shrink C3 builds 2022-03-22 10:46:57 -07:00
Scott Shawcroft 4363361c87
Board definition clean up
Removes:
* AUTORESET_DELAY_MS which never did anything but was introduced
  somehow.
* CIRCUITPY_BOOT_BUTTON in all but one ESP board because they all have
  them. There is a default based on the strapping pins.
* BOARD_USER_SAFE_MODE_ACTION because it was all the same for boards
  with boot buttons. Now the safe mode code manages the message.
2022-03-21 17:58:43 -07:00
Scott Shawcroft 623b6fad16
Fix nested categories in update_sdkconfig.py
Also, mark QTPy C3 as BIN only.
2022-03-21 17:04:19 -07:00
Scott Shawcroft 6dd9db31b3
Add USB to Serial/JTAG support for REPL
Adds Adafruit QT Py C3 board that uses it. Also revamps size
check script to work for S3 and C3 as well.

Fixes #6030
2022-03-21 14:03:57 -07:00
Jeff Epler 4465adfe01
Merge pull request #6175 from tannewt/mdns
Add mdns module
2022-03-21 15:55:03 -05:00
Scott Shawcroft 92d946fcac
Guard against NULL result 2022-03-21 10:15:46 -07:00
lady ada fdf27eee12 add feather esp32-s3 8mb flash, 0 psram 2022-03-19 23:04:20 -04:00
Scott Shawcroft 6f0d62d85e
Formatting and shrink build size on C3 2022-03-18 12:05:54 -07:00
Scott Shawcroft 8319faa032
Merge pull request #6155 from prplz/lilygo_ttgo_t-01c3
Add board lilygo_ttgo_t-01c3
2022-03-17 18:41:05 -07:00
Jeff Epler e9d81c2826
Add mdns module
This allows for CircuitPython to resolve a .local domain and find
other devices with MDNS services.

First step for #6174
2022-03-17 18:16:16 -07:00
Dan Halbert bad6cdcfa5
Merge pull request #6160 from tannewt/merge_7.2.2
Merge 7.2.2 changes into main
2022-03-17 20:02:30 -04:00
Scott Shawcroft 51701e6abe
Merge remote-tracking branch 'adafruit/7.2.x' into merge_7.2.2 2022-03-17 14:15:55 -07:00