Commit Graph

27307 Commits

Author SHA1 Message Date
Hosted Weblate 6db3161548
Merge remote-tracking branch 'origin/main' 2021-11-24 20:41:57 +01:00
Scott Shawcroft b09c777d0a
Merge pull request #5584 from gamblor21/is31
IS31FL3741 Framebuffer Driver
2021-11-24 11:41:51 -08:00
Scott Shawcroft a55c2ae8a7
Print git log on tag failure 2021-11-24 11:24:23 -08:00
Jeff Epler ddf24772c3
tests: move bitmaptools files to their own directory 2021-11-24 09:53:19 -06:00
Jeff Epler 30c07a772f
bitmaptools: dither: get rid of shifts
this happens to make the occasional FS dither artifact disappear.
I guess `a * b >> 8` and `(a * b) / 256` are not identical.  I'm not
sure if it was just the parens or not, but write the clearer code and
rely on the compiler to substitute an appropriate shift if possible.
2021-11-24 09:51:24 -06:00
Jeff Epler 9af76a2f03
bitmaptools dither: Fix off-by-one error filling row data 2021-11-24 09:51:23 -06:00
Jeff Epler 6191696232
bitmaptools: Fix the DitgherAlorithm.FloydStenberg value 2021-11-24 09:51:19 -06:00
Dan Halbert 2abd51274a empty commit 2021-11-24 10:00:05 -05:00
Dan Halbert 2afe599811
Add missing include for zero2w pins.c 2021-11-24 09:43:06 -05:00
microDev e5c125d153
update espressif makefile formatting 2021-11-24 18:14:54 +05:30
microDev 7ba5513f9a
update espressif port
- update esp-idf to v4.4
- add esp32s3 support
- add analogio on esp32c3
- disable rgbmatrix on all espressif soc

Co-authored-by: Scott Shawcroft <scott@adafruit.com>
Co-authored-by: Seon Rozenblum <seon@unexpectedmaker.com>
2021-11-24 18:01:34 +05:30
robert-hh 81f706aee4 mimxrt: Support PWM using the FLEXPWM and QTMR modules.
Frequency range 15Hz/18Hz to > 1 MHz, with decreasing resolution of the
duty cycle.  The basic API is supported as documentated, except that
keyword parameters are accepted for both the instatiaton and the
PWM.init() call.

Extensions: support PWM for channel pairs.  Channel pairs are declared by
supplying 2-element tuples for the pins.  The two channels of a pair must
be the A/B channel of a FLEXPWM module.  These form than a complementary
pair.

Additional supported keyword arguments:

- center=value Defines the center position of a pulse within the pulse
  cycle.  The align keyword is actually shortcut for center.

- sync=True|False: If set to True, the channels will be synchronized to a
  submodule 0 channel, which has already to be enabled.

- align=PWM.MIDDLE | PMW.BEGIN | PWM.END. It defines, whether synchronized
  channels are Center-Aligned or Edge-aligned.  The channels must be either
  complementary a channel pair or a group of synchronized channels.  It may
  as well be applied to a single channel, but withiout any benefit.

- invert= 0..3. Controls ouput inversion of the pins.  Bit 0 controls the
  first pin, bit 1 the second.

- deadtime=time_ns time of complementary channels for delaying the rising
  slope.

- xor=0|1|2 xor causes the output of channel A and B to be xored.  If
  applied to a X channel, it shows the value oif A ^ B.  If applied to an A
  or B channel, both channel show the xored signal for xor=1.  For xor=2,
  the xored signal is split between channels A and B.  See also the
  Reference Manual, chapter about double pulses.  The behavior of xor=2 can
  also be achieved using the center method for locating a pulse within a
  clock period.

The output is enabled for board pins only.

CPU pins may still be used for FLEXPWM, e.g. as sync source, but the signal
will not be routed to the output.  That applies only to FLEXPWM pins.  The
use of QTMR pins which are not board pins will be rejected.

As part of this commit, the _WFE() statement is removed from
ticks_delay_us64() to prevent PWM glitching during calls to sleep().
2021-11-24 13:48:27 +11:00
Scott Shawcroft 927a720de9
Fix I2C and feedback from Dan 2021-11-23 17:23:13 -08:00
gamblor21 97032fdbd0 Renaming files 2021-11-23 17:21:13 -06:00
gamblor21 9f2660f6ac Capitalization changes 2021-11-23 17:06:39 -06:00
gamblor21 9b85714b76 Removed unused imports 2021-11-23 13:24:36 -06:00
gamblor21 fc3b0340b5 Remove hard coded mapping of LEDs 2021-11-23 13:21:09 -06:00
gamblor21 f7df39ef88 Re-enable on microbit v2 2021-11-23 13:20:00 -06:00
Jeff Epler b1a3ccb36c
clear out interrupt when freeing the timer
Closes #5418
2021-11-23 13:03:01 -06:00
Hosted Weblate 4e8a1ee2c6
Merge remote-tracking branch 'origin/main' 2021-11-23 19:32:54 +01:00
Scott Shawcroft af2ac0aa60
Merge pull request #5602 from aivarannamaa/skip-main-script-in-raw-mode-soft-reboot
Don't run main script when soft-rebooting in raw mode
2021-11-23 10:32:48 -08:00
Hosted Weblate 39eefc62f5
Merge remote-tracking branch 'origin/main' 2021-11-23 19:26:48 +01:00
Scott Shawcroft 565bfeb28e
Merge pull request #5611 from jepler/issue5588
Don't use reset reason to skip writing boot_out.txt
2021-11-23 10:26:39 -08:00
Jeff Epler f495ea4760
Don't use reset reason to skip writing boot_out.txt
As @neradoc and @anecdata noted, we can't depend on the reset reason.

Instead, just rely on the existing safe mode logic (the write already is
skipped anytime boot.py was skipped), and otherwise potentially write
boot_out.txt anytime it differs from the version on disk (or if the file
doesn't exist in the first place)

Testing performed: On qtpy m0 haxpress, removed boot_out.txt and clicked
reset button.  verified boot_out.txt was recreated.

Closes #5588
2021-11-23 10:51:21 -06:00
Pierre Constantineau 81eed3ff4e
Merge branch 'adafruit:main' into seeduino-xiao-rp2040 2021-11-22 17:12:35 -06:00
Pierre Constantineau 401f1fadaf
Merge branch 'adafruit:main' into board-pykey87 2021-11-22 17:11:36 -06:00
Timon a1052d5f73
Initial broadcom port for Raspberry Pi
This targets the 64-bit CPU Raspberry Pis. The BCM2711 on the Pi 4
and the BCM2837 on the Pi 3 and Zero 2W. There are 64-bit fixes
outside of the ports directory for it.

There are a couple other cleanups that were incidental:
* Use const mcu_pin_obj_t instead of omitting the const. The structs
  themselves are const because they are in ROM.
* Use PTR <-> OBJ conversions in more places. They were found when
  mp_obj_t was set to an integer type rather than pointer.
* Optimize submodule checkout because the Pi submodules are heavy
  and unnecessary for the vast majority of builds.

Fixes #4314
2021-11-22 14:54:44 -08:00
Aivar Annamaa e8c809e594
Fix formatting 2021-11-22 23:45:28 +02:00
Aivar Annamaa 0c4597f387
Move friendly REPL check to main function 2021-11-22 21:28:39 +02:00
Hosted Weblate f37ac95bef
Merge remote-tracking branch 'origin/main' 2021-11-22 20:02:47 +01:00
Scott Shawcroft 387a8a46b3
Merge pull request #5605 from jepler/bitmaptools-bugfixes
Bitmaptools bugfixes
2021-11-22 11:02:40 -08:00
Hosted Weblate eada903a71
Merge remote-tracking branch 'origin/main' 2021-11-22 18:38:23 +01:00
Dan Halbert 40a00c1e53
Merge pull request #5608 from microDev1/traceback
Traceback object init - set it to empty only if null
2021-11-22 12:38:18 -05:00
microDev ed9595a9be
traceback object init - set it to empty only if null 2021-11-22 21:38:02 +05:30
Damien George bb7aae557b tools/autobuild: Automatically build all stm32 boards.
Any board with a board.json file will be built.  Additional variants for
certain pyboards will also be built by the explicit build-stm32-extra.sh
script.  Both .dfu and .hex files will be made available.

Also build boards in a sorted order, and don't stop building if a single
board fails.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 17:12:16 +11:00
Damien George 90554d03c0 stm32/boards: Build NUCLEO_WB55 and STM32F769DISC without mboot enabled.
This is to make the builds for all nucleo/discovery boards uniform, so they
can be treated the same by the auto build scripts.

The CI script is updated to explicitly enable mboot and packing, to test
these features.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 17:12:16 +11:00
Laurens Valk e2ca8ab8fc py/runtime: Allow types to use both .attr and .locals_dict.
Make it possible to proceed to a regular lookup in locals_dict if the
custom type->attr fails.  This allows type->attr to extend rather than
completely replace the lookup in locals_dict.

This is useful for custom builtin classes that have mostly regular methods
but just a few special attributes/properties.  This way, type->attr needs
to deal with the special cases only and the default lookup will be used for
generic methods.

Signed-off-by: Laurens Valk <laurens@pybricks.com>
2021-11-22 12:10:35 +11:00
Damien George 01ceb9aca3 stm32/dma: Make DMA2_Stream3 exclusive to SDIO when CYW43 enabled.
This prevents SPI4/5 from being used if SDIO and CYW43 are enabled, because
the DMA for the SDIO is used on an IRQ and must be exclusivly available for
use by the SDIO peripheral.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 11:57:37 +11:00
Damien George dfa75f33a5 stm32/sdio: Don't explicitly disable DMA2 on deinit of SDIO.
Because DMA2 may be in use by other peripherals, eg SPI1.

On PYBD-SF6 it's possible to trigger a bug in the existing code by turning
on WLAN and connecting to an AP, pinging the IP address from a PC and
running the following code on the PYBD:

    def spi_test(s):
        while 1:
            s.write('test')
            s.read(4)

    spi_test(machine.SPI(1,100000000))

This will eventually fail with `OSError: [Errno 110] ETIMEDOUT` because
DMA2 was turned off by the CYW43 driver during the SPI1 transfer.

This commit fixes the bug by removing the code that explicitly disables
DMA2.  Instead DMA2 will be automatically disabled after an inactivity
timeout, see commit a96afae90f

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 11:57:37 +11:00
Peter Boin e83aa252f7 stm32/main: Run optional frozen module at boot.
If a board specifies a filename via MICROPY_BOARD_FROZEN_BOOT_FILE then
that will be run on start up, before the usual boot.py.
2021-11-22 11:56:24 +11:00
gamblor21 c38612d59d Fixed capitalization 2021-11-21 11:39:42 -06:00
gamblor21 5337e45411 Only enable if not disabled 2021-11-21 11:39:42 -06:00
Jeff Epler 711f1f833b
bitmaptools: Fix the case where `factor`'s Python type is int
mp_obj_float_get gets the value of an object, which must be
exactly a float.  mp_obj_get_float gets the float value of
an object of various types, including floats & ints.
2021-11-20 21:15:26 -05:00
Jeff Epler 492402f23f
these must be treated as manual tests for now 2021-11-20 21:14:31 -05:00
Jeff Epler db44df5dbf
blend & dither tests 2021-11-20 21:13:56 -05:00
gamblor21 5243a33584 Check map to display size 2021-11-20 14:04:49 -06:00
gamblor21 16c52b76d6 Capitalize module 2021-11-20 14:04:49 -06:00
gamblor21 6d412e20c4 Disabling from some boards 2021-11-20 14:04:49 -06:00
gamblor21 6b2d43d3c8 Mapping for LEDs to diplay 2021-11-20 14:04:49 -06:00
gamblor21 9fa3feffb1 Cleanup 2021-11-20 13:46:12 -06:00