Commit Graph

18096 Commits

Author SHA1 Message Date
Jeff Epler
e477d27be3
Update shared-bindings/rgbmatrix/RGBMatrix.c
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2020-10-01 10:59:02 -05:00
Jeff Epler
d7c3f811af sharpdisplay: Fix memory corruption across soft-reset
It was incorrect to NULL out the pointer to our heap allocated buffer in
`reset`, because subsequent to framebuffer_reset, but while
the heap was still active, we could call `get_bufinfo` again,
leading to a fresh allocation on the heap that is about to be destroyed.

Typical stack trace:
```
#1  0x0006c368 in sharpdisplay_framebuffer_get_bufinfo
#2  0x0006ad6e in _refresh_display
#3  0x0006b168 in framebufferio_framebufferdisplay_background
#4  0x00069d22 in displayio_background
#5  0x00045496 in supervisor_background_tasks
#6  0x000446e8 in background_callback_run_all
#7  0x00045546 in supervisor_run_background_tasks_if_tick
#8  0x0005b042 in common_hal_neopixel_write
#9  0x00044c4c in clear_temp_status
#10 0x000497de in spi_flash_flush_keep_cache
#11 0x00049a66 in supervisor_external_flash_flush
#12 0x00044b22 in supervisor_flash_flush
#13 0x0004490e in filesystem_flush
#14 0x00043e18 in cleanup_after_vm
#15 0x0004414c in run_repl
#16 0x000441ce in main
```
When this happened -- which was inconsistent -- the display would keep
some heap allocation across reset which is exactly what we need to avoid.

NULLing the pointer in reconstruct follows what RGBMatrix does, and that
code is a bit more battle-tested anyway.

If I had a motivation for structuring the SharpMemory code differently,
I can no longer recall it.

Testing performed: Ran my complicated calculator program over multiple
iterations without observing signs of heap corruption.

Closes: #3473
2020-10-01 09:22:09 -05:00
Wellington Terumi Uemura
4799333ec2
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (827 of 827 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/
2020-10-01 16:20:05 +02:00
Jeff Epler
9e66c3aee1
Merge pull request #3494 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-10-01 09:19:52 -05:00
FoamyGuy
422a7d4013 remove remaining top level displayio background check 2020-09-30 17:25:58 -05:00
Unexpected Maker
1a099966ce
Merge pull request #1 from tannewt/UM_S2_Boards
Um s2 boards
2020-10-01 07:27:29 +10:00
Lucian Copeland
c624c1e838 Merge branch 'esp32-update-idf' into esp32-analogin 2020-09-30 16:51:19 -04:00
Lucian Copeland
e01e8dd6b9 Revert HAL refactor changes to avoid USB breaking changes past esp-idf dde6222cd 2020-09-30 16:36:13 -04:00
Scott Shawcroft
a6cfa507b6
Add to board list 2020-09-30 12:59:56 -07:00
Scott Shawcroft
a739d314f1
Add Metro ESP32S2
Also fix two bugs:
* Crash when resetting board.SPI when it hasn't been inited.
* Reading back the output value is always false. Fixes #3353
2020-09-30 12:57:39 -07:00
Hosted Weblate
b26c34d9e2 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2020-09-30 21:16:22 +02:00
Jonny Bergdahl
cebaf99c64 Translated using Weblate (Swedish)
Currently translated at 100.0% (826 of 826 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/
2020-09-30 21:16:22 +02:00
Wellington Terumi Uemura
9d0d3e3615 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (826 of 826 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/
2020-09-30 21:16:22 +02:00
Scott Shawcroft
7f803c0b51
Merge pull request #3489 from astrobokonon/esp32s2-fixconnection
ESP32S2: Enter station mode before connecting
2020-09-30 12:16:15 -07:00
Scott Shawcroft
5ac3c36d64
Merge pull request #3450 from mdroberts1243/New_quirk_for_SH1107
New quirk for sh1107
2020-09-30 12:03:10 -07:00
FoamyGuy
d1bda47d94 removing top level displayio background check 2020-09-30 14:03:03 -05:00
Scott Shawcroft
2ac2f627d5
Merge pull request #3466 from jepler/canbus-api-changes
Canbus: api changes
2020-09-30 11:43:08 -07:00
Scott Shawcroft
5ca10e7849
Merge pull request #3472 from weblate/weblate-circuitpython-main
Translations update from Weblate
2020-09-30 11:42:57 -07:00
Scott Shawcroft
a09a158ddc
Fix trailing line 2020-09-30 11:36:51 -07:00
Scott Shawcroft
29af7068d4
Ignore duplicate USB PID for prerelease version 2020-09-30 11:33:54 -07:00
Mark Roberts
ef245ef54e
Removed redundant subrectangle sizing code 2020-09-30 11:06:13 -07:00
Mark Roberts
9f19a8a760
Ran pre-commit locally 2020-09-30 11:06:13 -07:00
Lucian Copeland
66b8559fd4 Change submodule, rework all includes 2020-09-30 11:26:07 -04:00
Jeff Epler
c129c8f296 Merge remote-tracking branch 'origin/main' into canbus-api-changes 2020-09-29 20:15:11 -05:00
Jeff Epler
88cbf772df canio.CAN: clarify read-only status of several properties 2020-09-29 20:13:52 -05:00
Jeff Epler
8f8326fe57 Makefile: Correct and expand translation excluded directories
As originally written, the TRANSLATE_SOURCES_EXC was incorrect.  If
more than one build directory existed, "make translate"
(and make check-translate) would error.

I corrected the problem, commented it, and added a number of additional
exclude directives.

I reviewed the PR and should have caught this, but did not.
2020-09-29 19:57:53 -05:00
Jeff Epler
e4b9c16891 rgbmatrix: Check that the number of rgb pins is supported.
Having zero RGB pins may not have been caught, nor having a non-multiple-of-6
value.  Generally, users will only have 6 RGB pins unless they are driving
multiple matrices in parallel.  No existing breakouts exist to do this, and
there are probably not any efficient pinouts to be had anyway.
2020-09-29 19:55:31 -05:00
Jeff Epler
176b337611 rgbmatrix: validate width= constructor parameter
In #3482, @cwalther noted that, hypothetically, a zero byte allocation
could be made in the RGBMatrix constructor.  Ensure that width is positive.
Height was already checked against the number of RGB pins if it was specified,
so zero is ruled out there as well.
2020-09-29 19:44:25 -05:00
Seon Rozenblum
819b5faa71 Removed ProS2 board files for now 2020-09-30 10:23:54 +10:00
Seon Rozenblum
4b1a7d812e Updated UM boards 2020-09-30 10:16:24 +10:00
Seon Rozenblum
a2a0aa058f Updated UM boards 2020-09-30 10:13:05 +10:00
Ryan T. Hamilton
2f6d7c9002 Make sure you're a STA before connecting 2020-09-29 13:41:56 -07:00
Hosted Weblate
28353973b2
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2020-09-29 21:32:56 +02:00
Maciej Stankiewicz
9b3e955bd4 Translated using Weblate (Polish)
Currently translated at 73.8% (595 of 806 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pl/
2020-09-29 21:32:54 +02:00
Hosted Weblate
38f12185aa Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/
2020-09-29 21:32:54 +02:00
Taku Fukada
88749fce64 Translated using Weblate (Japanese)
Currently translated at 73.2% (591 of 807 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ja/
2020-09-29 21:32:54 +02:00
Alvaro Figueroa
c1ac0eed2f Translated using Weblate (Spanish)
Currently translated at 100.0% (807 of 807 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/
2020-09-29 21:32:54 +02:00
Jeff Epler
2bb44f6c4d
Merge pull request #3486 from microDev1/fixTranslate
Update make translate script
2020-09-29 14:32:49 -05:00
Jeff Epler
d79f4e2662 canio: doc improvement -- don't needlessly call out deinit behavior 2020-09-29 14:32:27 -05:00
Jeff Epler
611f81ac1a canio: actually drop the _error_count properties
thanks @tannewt
2020-09-29 14:25:53 -05:00
Jeff Epler
1bea099eb2 Allow the _state_count properties to be unimplemented
This is the case on the SPI implementations MCP2515 and MCP2518.
2020-09-29 14:05:50 -05:00
microDev
4c7d9e3aaf
Update make translate script 2020-09-29 11:14:30 +05:30
Jeff Epler
d4ee440a91
Merge pull request #3475 from tannewt/esp_uf2
Reorganize sdkconfigs and release UF2s
2020-09-28 20:39:37 -05:00
Jeff Epler
03bd968450 more doc improvements 2020-09-28 19:56:19 -05:00
Jeff Epler
979ec3a458 can: RemoteTransmissionRequest: remove duplicate docstrings 2020-09-28 19:47:06 -05:00
Ryan T. Hamilton
2a4a244245 Add ap_ssid and ap_bssid 2020-09-28 17:25:09 -07:00
Jeff Epler
dd6e7f5a8a mimxrt10xx: Add required header for NORETURN definition 2020-09-28 18:56:01 -05:00
Jeff Epler
1dbb59271c esp32: Use esp_restart from reset_to_bootloader; redeclare it NORETURN 2020-09-28 18:56:01 -05:00
Jeff Epler
726dcdb60a Add some NORETURN attributes
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom:
```
int find_unused_slot(void) {
    // precondition: you already verified that a slot was available
    for (int i=0; i<NUM_SLOTS; i++) {
        if( slot_free(i)) {
            return i;
        }
    }
    safe_mode_reset(MICROPY_FATAL_ERROR);
}
```
However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN.

So I started by teaching the compiler that reset_into_safe_mode never returned.  This leads at least one level deeper due to reset_cpu needing to be a NORETURN function.  Each port is a little different in this area.  I also marked reset_to_bootloader as NORETURN.
Additional notes:

 * stm32's reset_to_bootloader was not implemented, but now does a bare reset.  Most stm32s are not fitted with uf2 bootloaders anyway.
 * ditto cxd56
 * esp32s2 did not implement reset_cpu at all.  I used esp_restart().  (not tested)
 * litex did not implement reset_cpu at all.  I used reboot_ctrl_write.  But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested).  reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added.
 * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added.
 * In several places, NVIC_SystemReset is redeclared with NORETURN applied.  This is accepted just fine by gcc.  I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared.
 * the stub safe_mode reset simply aborts.  This is used in mpy-cross.
2020-09-28 18:55:56 -05:00
Ryan T. Hamilton
7b7ef8edde Merge branch 'main' of https://github.com/adafruit/circuitpython into esp32s2-morenet 2020-09-28 16:50:02 -07:00