Commit Graph

24262 Commits

Author SHA1 Message Date
Jeff Epler a703561402 remove docs added in merge 2021-06-18 16:02:44 -05:00
hathach 683304fd3c update tinyusb to fix nrf control race condition 2021-06-19 02:27:41 +07:00
Jeff Epler 198e3aded7 imagecapture: Fix doc markup, update docs for data_pins
Closes: #4896
2021-06-18 12:40:35 -05:00
Dan Halbert db297add67 fix other too-big builds 2021-06-18 13:20:31 -04:00
Dan Halbert 03adbbca7c turn off keypad by default on all SAMD21, for now 2021-06-18 12:26:48 -04:00
Jeff Epler fa29be5aea restore a redundant NULL-comparison, it silences compiler diagnostics 2021-06-18 11:24:39 -05:00
Jeff Epler e1d7e46e88 fix keyboard interrupt 2021-06-18 11:15:51 -05:00
Dan Halbert 8cd7e774e7 add KeyMatrix columns_to_anodes arg 2021-06-18 12:03:47 -04:00
Jeff Epler 8647097078 remove micropython board 2021-06-18 10:59:52 -05:00
Jeff Epler c50c05aa21 remove workflow file from micropython 2021-06-18 10:58:57 -05:00
Jeff Epler 7b46187024 Fix trailing whitespace 2021-06-18 10:58:30 -05:00
Jeff Epler 87d3740c64 Merge tag 'v1.16' 2021-06-18 10:54:19 -05:00
Damien George 7c51cb2307 all: Bump version to 1.16.
Signed-off-by: Damien George <damien@micropython.org>
2021-06-18 16:38:06 +10:00
Damien George adf35cbab0 tests/float: Make bytes/bytearray construct tests work with obj repr C.
2.5 can be represented correctly in object representation C, but 2.3 cannot
(it is slightly truncated).

Signed-off-by: Damien George <damien@micropython.org>
2021-06-18 14:16:07 +10:00
Damien George bc89cdeb45 py/gc: Only use no_sanitize_address attribute for GCC 4.8 and above.
It's not supported on older GCC versions.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-18 14:15:37 +10:00
Damien George eb7ae538f9 esp8266/boards/GENERIC_512K: Add custom minimal _boot.py.
Commit 0abf6f830c removed _boot.py from the
manifest for the GENERIC_512K board because the build does not include a
filesystem.  But the main code expects _boot.py to be there and prints an
error if it's not.  So add a custom _boot.py, which just sets the
gc.threshold().

Signed-off-by: Damien George <damien@micropython.org>
2021-06-18 14:13:18 +10:00
Dan Halbert af66931f71 Added keypad.ShiftRegisterKeys 2021-06-17 20:51:45 -04:00
Damien George 4eb13c50cd esp32/machine_sdcard: Use deinit_p to deinit SD bus in SPI mode.
Fixes issue #7352.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-18 09:55:22 +10:00
Dan Halbert 04b69cde9b turn off gamepad on most builds;turn off keypad where appropriate 2021-06-17 13:46:45 -04:00
Dan Halbert a152bd3b72 add .num_keys and .store_states() to Keys and KeyMatrix 2021-06-17 12:02:54 -04:00
Mike Causer bc7822d8e9 drivers/display/ssd1306.py: Add support for 72x40 displays.
The 72x40 OLED requires selecting the internal IREF, as opposed to the
default external IREF.  This is an undocumented feature in the SSD1306
datasheet, but is present in the SSD1315 datasheet.  It's possible the
72x40 OLED is actually using the newer SSD1315 controller.  Sending the
IREF select command to SSD1306 displays has no effect on them, so it's
added to the init_display() instead of wrapping in an "if width = 72".

Also tested on a 128x64 OLED using the SSD1315 controller (smaller ribbon
cable) and the proposed change has no effect on the display, as the module
comes with the correct current limiting resistor.  Internal and external
IREF work the same.

Fixes issue #7281.
2021-06-17 18:54:32 +10:00
Jonathan Hogg 89945b1989 esp32/machine_hw_spi: Allow None for unused pins in initializer.
Make the hardware SPI initializer method match the `init()` method by 
allowing `None` to be given for `sck`/`mosi`/`miso` to specify an unused 
signal.
2021-06-17 18:52:22 +10:00
Thomas Wenrich 364670ecf1 docs/esp32: Document WLAN "reconnects" config option. 2021-06-17 18:48:17 +10:00
Thomas Wenrich 060066804a esp32/modnetwork: Add "reconnects" option to WLAN STA interface.
This adds a wlan.config(reconnects=N) option to set the number of reconnect
attempts that will be made if the WLAN connection goes down.  The default
is N=-1 (infinite retries, current behavior).  Setting
wlan.config(reconnects=0) will disable the reconnect attempts.

A nice side effect of reconnects=0 is that wlan.status() will report the
disconnect reason now.  See related issue #5326.
2021-06-17 18:48:06 +10:00
Tobias Eydam 48437cec45 esp32/network_lan: Add Ethernet support for IDF v4.1 and above.
Ethernet-PHYs from ESP-IDF (LAN8720, IP101, RTL8201, DP83848) are now
supported in IDF v4.1 and above.  PHY_KSZ8041 is only for ESP-IDF 4.3 and
above.  ESP32S2 is not supported.

Signed-off-by: Tobias Eydam <eydam-prototyping@outlook.com>
2021-06-17 15:36:14 +10:00
Damien George 8107c9b75b extmod/nimble: Remove TODO comment about notify_custom freeing om.
The comments in NimBLE for ble_gattc_notify_custom() state that "This
function consumes the supplied mbuf regardless of the outcome.".  And
inspection of NimBLE code shows that this is the case.  So the comment can
be removed.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-17 14:54:04 +10:00
Dan Halbert cd31136c30 factor out keypad.EventQueue 2021-06-16 15:55:54 -04:00
Dan Halbert 3d18c5c327 Use a single list of keypad scanners 2021-06-16 13:29:38 -04:00
Damien George 514bf1a191 extmod/uasyncio: Fix race with cancelled task waiting on finished task.
This commit fixes a problem with a race between cancellation of task A and
completion of task B, when A waits on B.  If task B completes just before
task A is cancelled then the cancellation of A does not work.  Instead,
the CancelledError meant to cancel A gets passed through to B (that's
expected behaviour) but B handles it as a "Task exception wasn't retrieved"
scenario, printing out such a message (this is because finished tasks point
their "coro" attribute to themselves to indicate they are done, and
implement the throw() method, but that method inadvertently catches the
CancelledError).  The correct behaviour is for B to bounce that
CancelledError back out.

This bug is mainly seen when wait_for() is used, and in that context the
symptoms are:
- occurs when using wait_for(T, S), if the task T being waited on finishes
  at exactly the same time as the wait-for timeout S expires
- task T will have run to completion
- the "Task exception wasn't retrieved message" is printed with
  "<class 'CancelledError'>" as the error (ie no traceback)
- the wait_for(T, S) call never returns (it's never put back on the
  uasyncio run queue) and all tasks waiting on this are blocked forever
  from running
- uasyncio otherwise continues to function and other tasks continue to be
  scheduled as normal

The fix here reworks the "waiting" attribute of Task to be called "state"
and uses it to indicate whether a task is: running and not awaited on,
running and awaited on, finished and not awaited on, or finished and
awaited on.  This means the task does not need to point "coro" to itself to
indicate finished, and also allows removal of the throw() method.

A benefit of this is that "Task exception wasn't retrieved" messages can go
back to being able to print the name of the coroutine function.

Fixes issue #7386.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-16 13:02:37 +10:00
Dan Halbert 4655a71793 Turn off keypad on some builds to avoid overflow 2021-06-15 14:11:04 -04:00
Dan Halbert f97e0ec631 fix ulab commit 2021-06-15 11:51:28 -04:00
robert-hh 8edc3aacdd mimxrt/modutime: Extend the time module.
Methods added:
- time.time()
- time.time_ns()
- time.gmtime()
- time.localtime()
- time.mktime()

The rp2 port was uses as the template for the change.
2021-06-16 01:50:09 +10:00
robert-hh 7417c6ac91 mimxrt/machine_pin: Implement pin.irq() functionality. 2021-06-16 01:42:10 +10:00
robert-hh 689476c576 mimxrt/machine_uart: Add the UART class to the machine module.
The implementation uses the LPUARTx devices.  Up to 8 UARTs can be used,
given that the pins are accessible.  E.g. 8 on Teensy 4.1, 5 on
MIMXRT1020_EVK.

For Tennsy 4.0 and 4.1 the UART numbers are as printed on the pinout 1..N.
The MIMXRT10xx-EVK boards have only one UART named, which gets the number
1.  All other UART are assigned to different Pins:

MIMXRT1010-EVK:
    D0/D1   UART 1
    D6/D7   UART 2
    A0/D4   UART 3

MIMXRT1020-EVK:
    D0/D1   UART 1
    D6/D9   UART 2
    D10/D12 UART 3
    D14/D15 UART 4
    A0/A1   UART 5

MIMXRT1050-EVK, MIMXRT1060-EVK, MIMXRT1064-EVK:
    D0/D1   UART 1
    D7/D6   UART 2
    D8/D9   UART 3
    A1/A0   UART 4
2021-06-16 01:21:15 +10:00
Dan Halbert a192f1ca2f merge from upstream 2021-06-15 11:21:08 -04:00
Dan Halbert 1803a6a71d both Keys and KeyMatrix work 2021-06-15 11:15:09 -04:00
Dan Halbert a4d6452452
Merge pull request #4890 from t-ikegami/fix_typo_pin_name_wio
Fix typo in a pin name of Wio Terminal
2021-06-15 09:08:18 -04:00
Tsutomu IKEGAMI fd222dd066 Fix typo in Wio Terminal pin board.I2S_BLCK to I2S_BCLK (bit clock) 2021-06-15 20:51:55 +09:00
Damien George d2dcd05adc tools/mpremote: Use signal to capture and handle ctrl-C on Windows.
Now a ctrl-C will not stop mpremote, rather this character will be passed
through to the attached device.

The mpremote version is also increased to 0.0.5.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-15 13:52:31 +10:00
Damien George 77c529e8be tools/mpremote: Use available ports instead of auto-connect list.
Using just the list of available ports, instead of a hard-coded list of
possible ports, means that all ports will be available for auto connection.
And the order that they will be attempted in will match what's printed by
"mpremote connect list" (and will be the same as before, trying ACMx before
USBx).  Auto-connect will also now work on Mac, and will allow all COM
ports on Windows.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-15 13:52:31 +10:00
Mike Teachman b0b8ebc4f6 extmod/uasyncio: Add readinto() method to Stream class.
With docs and a multi-test using TCP server/client.

This method is a MicroPython extension, although there is discussion of
adding it to CPython: https://bugs.python.org/issue41305

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-06-15 13:13:35 +10:00
Dan Halbert 350652ee21 Keys works; more testing to do 2021-06-14 22:59:17 -04:00
Dan Halbert 32eec85230 compiles 2021-06-14 20:54:43 -04:00
Dan Halbert b151bee0a2
Merge pull request #4887 from mcauser2/tinys2spi
Change TinyS2 default SPI pins
2021-06-14 19:30:26 -04:00
Dan Halbert 278ebef878
Merge pull request #4889 from kattni/slider-trinkey-add-a0
Add A0 as alias to potentiometer pin.
2021-06-14 16:36:46 -04:00
Dan Halbert 627c426259 wip 2021-06-14 16:00:15 -04:00
Kattni Rembor 12d0e65a2a Space out pin groups. 2021-06-14 15:37:02 -04:00
Kattni Rembor f96642de25 Add A0 as alias to pot pin. 2021-06-14 15:32:12 -04:00
Mike Causer ceea6397a3 Change TinyS2 default SPI pins 2021-06-15 01:17:39 +10:00
Pavol Rusnak 95048129b1 unix: Fix build on arm64-darwin due to integer cast.
This fixes error: cast to smaller integer type 'int' from 'pthread_t'.
pthread_t is defined as long, not as int.

Signed-off-by: Pavol Rusnak <pavol@rusnak.io>
2021-06-15 00:08:24 +10:00