Commit Graph

24378 Commits

Author SHA1 Message Date
Scott Shawcroft 25ccd5d8f1
Merge pull request #4679 from t-ikegami/wio_add_pin_assign
Add DAC* and RTL_* pin assignments to Wio Terminal board.
2021-05-03 11:08:28 -07:00
Scott Shawcroft 5045009611
Merge pull request #4694 from dhalbert/remove-pwmout-from-pulseio
remove PWMOut from pulseio
2021-05-03 11:07:36 -07:00
Scott Shawcroft 678279720f
Merge pull request #4702 from rsbohn/patch-1
esp32-s2: Don't set PWMOut frequency to 0
2021-05-03 11:01:59 -07:00
Randall Bohn d1db782760
Move validation code to the right spot.
As MicroDev1 pointed out the problem is a divide by zero when calculating the duty cycle.
Maybe need to check again in `common_hal_pwmio_pwmout_set_frequency()`.
2021-05-03 09:16:46 -06:00
Dan Halbert 83c4be63d2 Merge remote-tracking branch 'adafruit/main' into remove-pwmout-from-pulseio 2021-05-03 11:04:55 -04:00
Randall Bohn 8613b9a9fe
Trim Trailing Whitespace
was causing pre-commit checks to fail
2021-05-03 07:41:52 -06:00
Dan Halbert 94ed5e0048
Merge pull request #4696 from dhalbert/no-pulseio-on-small-boards
Include pulseio only on CIRCUITPY_FULL_BUILD
2021-05-03 09:35:29 -04:00
Dan Halbert 9ca0e689a5
Merge branch 'main' into wio_add_pin_assign 2021-05-03 09:33:18 -04:00
Dan Halbert 8b8968101d
Merge pull request #4691 from nm3210/sparkfunthingplusrp2040_boardupdate
Update Sparkfun Thing Plus RP2040 pins to match board breakouts
2021-05-03 09:27:19 -04:00
Dan Halbert 4fafdf7e42
Merge pull request #4678 from jposada202020/defining_parameters
Defining parameters
2021-05-03 09:22:09 -04:00
Randall Bohn 2db113f191
esp32-s2: Don't set PWMOut frequency to 0
FeatherS2 crashes if you set the PWMOut frequency to 0.
This change will raise `ValueError: Invalid PWM frequency` if the requested frequency is 0.
(Lifted from the atmel-samd port)
2021-05-03 07:15:39 -06:00
Dan Halbert e475dc8899 Fix broken builds 2021-05-03 00:09:15 -04:00
robert-hh 1e2f0d2809 rp2/tusb_port: Add the device unique-id to the USB id.
The number shown in the USB id is now the same as that returned by
machine.unique_id().  All 8 bytes are inserted as hex into the USB id.  A
usb id at /dev/serial/by-id then looks like:

    usb-MicroPython_Board_in_FS_mode_e469b03567342f37-if00
2021-05-02 23:38:01 +10:00
Jan Jurgen Griesfeller d80a037e6b rp2/boards: Add board definition for SparkFun Pro Micro board. 2021-05-02 23:23:27 +10:00
Jan Jurgen Griesfeller 3c918d0f58 rp2/boards: Add board definition for SparkFun Thing Plus RP2040. 2021-05-02 23:22:46 +10:00
Artyom Skrobov ca35c0059c py/repl: Autocomplete builtin modules.
Doing "import <tab>" will now complete/list built-in modules.

Originally at adafruit#4548 and adafruit#4608

Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02 23:11:14 +10:00
Artyom Skrobov 7556e01f14 py/repl: Refactor autocomplete, extracting reusable parts.
Originally at adafruit#4548

Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02 23:11:12 +10:00
Artyom Skrobov f85ea8d4fe py/repl: Refactor autocomplete to reduce nesting.
Originally at adafruit#4548

Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
2021-05-02 23:11:10 +10:00
scottbelden befbff31b7 py/repl: Enter four spaces when there are no matches.
Originally at adafruit#1859

Signed-off-by: scottbelden <scottabelden@gmail.com>
2021-05-02 23:11:07 +10:00
Kathryn Lingel 1f1a54d0b1 py/repl: Filter private methods from tab completion.
Anything beginning with "_" will now only be tab-completed if there is
already a partial match for such an entry.  In other words, entering
foo.<tab> will no longer complete/list anything beginning with "_".

Originally at adafruit#1850

Signed-off-by: Kathryn Lingel <kathryn@lingel.net>
2021-05-02 23:11:03 +10:00
Dan Halbert 749a3ac978 remove pwmio from litex port 2021-05-01 23:22:52 -04:00
Dan Halbert e6dc3e4686
Merge pull request #4698 from tyomitch/microbit
`workflow_active` was never defined or used
2021-05-01 15:26:57 -04:00
Dan Halbert 1ca805887f Fix broken builds 2021-05-01 14:35:24 -04:00
Artyom Skrobov 9a5fb44c76 `workflow_active` was never defined or used
`supervisor_workflow_active` needs to be stubbed for when there's no USB
2021-05-01 13:34:28 -04:00
Dan Halbert ebedeeb51d
Merge pull request #4695 from dhalbert/magtag-spi-naming
MagTag: Remove board.SPI(); rename display-only pins
2021-05-01 09:44:42 -04:00
Dan Halbert 07dab34294 re-enable for pirkey 2021-05-01 09:32:13 -04:00
Dan Halbert cae31d6762 remove PWMOut from pulseio 2021-05-01 09:31:11 -04:00
Damien George aa061ae391 py/scheduler: Add missing MICROPY_WRAP_MP_SCHED_EXCEPTION usage.
This was missed in commit 7cbf826a95.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-01 23:10:26 +10:00
Dan Halbert fb80cc4810
Merge pull request #4692 from jepler/fix-codeformat-subdirs
codeformat: Fix filename matching
2021-04-30 23:31:08 -04:00
Dan Halbert 96101016ec Include pulseio only on CIRCUITPY_FULL_BUILD 2021-04-30 23:13:32 -04:00
Dan Halbert 670c49ed94 MagTag: Remove board.SPI(); rename display-only pins 2021-04-30 22:58:51 -04:00
Jeff Epler 1a52cbcf5d Format a straggler file 2021-04-30 16:42:25 -05:00
Jeff Epler da19e8e2d7 Merge remote-tracking branch 'origin/main' into fix-codeformat-subdirs 2021-04-30 15:31:08 -05:00
Jeff Epler dfa7c3d32d codeformat: Fix handling of `**`
After discussing with danh, I noticed that `a/**/b` would not match `a/b`.

After correcting this and re-running "pre-commit run --all", additional
files were reindented, including the codeformat script itself.
2021-04-30 15:30:13 -05:00
nm3210 929ee8d3b4 Fix pre-commit whitespace error 2021-04-30 14:16:13 -04:00
Scott Shawcroft d93a9a1dbc
Merge pull request #4683 from DavePutz/issue_4661
Issue #4661 - Wrap pulsein values when maxlen is exceeded.
2021-04-30 11:07:54 -07:00
Scott Shawcroft 0573c17d70
Merge pull request #4690 from jepler/fix-vm-dispatch
py/vm.c: Restore lost bits of MICROPY_OPT_COMPUTED_GOTO_SAVE_SPACE
2021-04-30 10:40:07 -07:00
microDev eebcd2eeaf
remove unsupported authmodes 2021-04-30 22:11:32 +05:30
microDev 6640db9555
make authmode settable 2021-04-30 21:35:02 +05:30
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
Dan Halbert 353e55d710
Merge pull request #4688 from jepler/fix-pixelbuf-subscr
objtype: Restore our customized behavior of instance_subscr
2021-04-30 10:45:44 -04:00
Dan Halbert be7b2b00a8 uncrustify with newer version of uncrustify 2021-04-30 10:40:12 -04:00
Jeff Epler 41b273e0c1 py/vm.c: Restore lost bits of MICROPY_OPT_COMPUTED_GOTO_SAVE_SPACE
This fixes a problem where boards that enabled this (most SAM D21s)
would crash on the first bytecode instruction.

Closes: #4686
2021-04-30 09:17:40 -05:00
Dan Halbert cc95b71d64 fix type annotations 2021-04-30 09:40:40 -04:00
nm3210 9c1466a330 Update Sparkfun Thing Plus RP2040 pins to match board
This fixes some missing and incorrectly-assigned pins for the SparkFun Thing Plus RP2040 protoboard so that they actually match what the board says. This also changes the default SPI pins from the SD card pins to the breakout pins on the side of the board.
2021-04-30 09:37:37 -04:00
microDev 7c845818b3
Merge branch 'main' into ap 2021-04-30 17:11:22 +05:30
Damien George dd5c831a0b docs/library/machine: Add machine.bootloader docs.
This is provide by a few ports now, and is very useful.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 16:55:55 +10:00
Damien George 9e1b25a99e docs/library/machine: Specify initial machine.PWM class.
This adds an initial specification of the machine.PWM class, to provide a
way to generate PWM output that is portable across the different ports.
Such functionality may already be available in one way or another (eg
through a Timer object), but because configuring PWM via a Timer is very
port-specific, and because it's a common thing to do, it's beneficial to
have a top-level construct for it.

The specification in this commit aims to provide core functionality in a
minimal way.  It also somewhat matches most existing ad-hoc implementations
of machine.PWM.

See discussion in #2283 and #4237.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 16:42:51 +10:00
Damien George 6b7c8d3e72 py/runtime: Remove commented-out code from mp_deinit().
These commented-out lines of code have been unused for a long time, so
remove them to avoid confusion as to why they are there.

mp_obj_dict_free() never existed, this line was converted from
mp_map_deinit() and commented out as soon as it was added.  The call to
mp_map_deinit(mp_loaded_modules_map) was commented in
1a1d11fa32.

Fixes issue #3507.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 16:35:14 +10:00
Damien George 1d9528210b tests/multi_bluetooth: Add performance test for gatt char writes.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 16:14:48 +10:00