summaryrefslogtreecommitdiff
path: root/shared-module
AgeCommit message (Collapse)Author
2020-11-18Fix Palette grayscale for EInk.Scott Shawcroft
It needs to do the bitmasking that was only added to ColorConverter in #3611
2020-11-13Add .busy property to EPaperDisplayScott Shawcroft
2020-11-13Add board.DISPLAY to MagTag. Fix luma computationScott Shawcroft
* Initialize the EPaper display on the MagTag at start. * Tweak the display send to take a const buffer. * Correct Luma math * Multiply the blue component, not add. * Add all of the components together before dividing. This reduces the impact of truncated division.
2020-11-09use full_change instead of movedfoamyguy
2020-11-08set moved true when unhiding tilegridfoamyguy
2020-10-31Merge pull request #3627 from adafruit/6.0.xDan Halbert
Merge 6.0.x bugfixes to main
2020-10-26Add grayscale EInk supportScott Shawcroft
2020-10-26Fix lost board.SPI and board.I2C after explicitly deiniting them.Christian Walther
After calling board.SPI().deinit(), calling board.SPI() again would return the unusable deinited object and there was no way of getting it back into an initialized state until the end of the session.
2020-10-26Fix lost board.SPI and board.I2C after being used by display.Christian Walther
Fixes #3581. Pins were marked as never_reset by common_hal_displayio_fourwire_construct() and common_hal_sharpdisplay_framebuffer_construct(), but these marks were never removed, so at the end of a session after displayio.release_displays(), {spi|i2c}_singleton would be set to NULL but the pins would not be reset. In the next session, board.SPI() and board.I2C() were unable to reconstruct the object because the pins were still in use. For symmetry with creation of the singleton, add deinitialization before setting it to NULL in reset_board_busses(). This makes the pins resettable, so that reset_port(), moved behind it, then resets them.
2020-10-26Fix erroneous claim of board.I2C() by deinited display.Christian Walther
At the end of a session that called displayio.release_displays() (and did not initialize a new display), a board.I2C() bus that was previously used by a display would wrongly be considered still in use. While I can’t think of any unrecoverable problem this would cause in the next session, it violates the assumption that a soft reboot resets everything not needed by displays, potentially leading to confusion. By itself, this change does not fix the problem yet - rather, it introduces the same issue as in #3581 for SPI. This needs to be solved in the same way for I2C and SPI.
2020-10-22sharpdisplay: Re-use supervisor allocations if possibleJeff Epler
This is enabled by #3482 I was unable to determine why previously I had added sizeof(void*) to the GC heap allocation, so I removed that code as a mistake.
2020-10-16displayio: Remove trailing whitespaceJensen
2020-10-16Merge branch 'main' into color-converter-transparencyJensen Kuras
2020-10-16displayio: Add in opaque pixel option for futureJensen
2020-10-15displayio: further ensure just one start_terminal callJeff Epler
@cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries. Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal. stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once. Slight behavioral change: The terminal size would follow the displays[0] size, not the displays[1] size
2020-10-14Merge branch 'color-converter-transparency' of ↵Jensen
github.com:jensechu/circuitpython into color-converter-transparency
2020-10-14displayio: ColorConverter handle if opaque color is blackJensen
2020-10-12Merge branch 'main' into color-converter-transparencyJensen Kuras
2020-10-12displayio: Add make_transparent to ColorConverterJensen
2020-10-12displayio: Add make_transparent and make_opaque to ColorConvertorJensen
2020-10-12displayio: Pass transparent_color to ColorConverterJensen
Signed-off-by: Jensen <jensechu@gmail.com>
2020-10-12Merge pull request #3537 from jepler/update-protomatter-2Scott Shawcroft
rgbmatrix: update protomatter to 1.0.5 tag
2020-10-12Merge pull request #3543 from jepler/rgbmatrix-brighness-crashScott Shawcroft
rgbmatrix: Don't crash when setting brightness=0
2020-10-12rgbmatrix: Don't crash when setting brightness=0Jeff Epler
If the display is paused, `_PM_swapbuffer_maybe` will never return. So, when brightness is 0, refresh does nothing. This makes it necessary to update the display when unpausing. Closes: #3524
2020-10-11displayio, framebufferio: Remove spurious call to supervisor_start_terminalJeff Epler
A call to supervisor_start_terminal remained in common_hal_displayio_display_construct and was copied to other display _construct functions, even though it was also being done in displayio_display_core_construct when that was factored out. Originally, this was harmless, except it created an extra allocation. When investigating #3482, I found that this bug became harmful, especially for displays that were created in Python code, because it caused a supervisor allocation to leak. I believe that it is safe to merge #3482 after this PR is merged.
2020-10-10rgbmatrix: update protomatter to 1.0.5 tagJeff Epler
this is compile-tested on stm32f405 feather matrixportal nrf52840 feather but not actually tested-tested.
2020-10-02Merge pull request #3507 from jepler/issue3506-matrixportal-crashLimor "Ladyada" Fried
displayio: Fix matrixportal crash
2020-10-02displayio: Fix matrixportal crashJeff Epler
An RGBMatrix has no bus and no bus_free method. It is always possible to refresh the display. This was not a problem before, but the fix I suggested (#3449) added a call to core_bus_free when a FramebufferDisplay was being refreshed. This was not caught during testing. This is a band-aid fix and it brings to light a second problem in which a SharpDisplay + FrameBuffer will not have a 'bus' object, and yet does operate using a shared SPI bus. This kind of display will need a "bus-free" like function to be added, or it can have problems like #3309.
2020-10-01Merge pull request #3497 from jepler/issue3473Scott Shawcroft
sharpdisplay: Fix memory corruption across soft-reset
2020-10-01Merge pull request #3495 from tannewt/esp32s2_metroScott Shawcroft
Add Metro ESP32S2
2020-10-01Merge pull request #3449 from FoamyGuy/sdcard_odb_fixScott Shawcroft
Sdcard odb fix
2020-10-01sharpdisplay: Fix memory corruption across soft-resetJeff Epler
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-09-30remove remaining top level displayio background checkFoamyGuy
2020-09-30Add Metro ESP32S2Scott Shawcroft
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-30Merge pull request #3450 from mdroberts1243/New_quirk_for_SH1107Scott Shawcroft
New quirk for sh1107
2020-09-30removing top level displayio background checkFoamyGuy
2020-09-30Removed redundant subrectangle sizing codeMark Roberts
2020-09-30Ran pre-commit locallyMark Roberts
2020-09-28Merge branch 'main' into New_quirk_for_SH1107mdroberts1243
2020-09-28modified _stage/__init__.c call to set region to updateMark Roberts
2020-09-28CAN: Use mp_obj_t insteaed of canio_message_obj_t, get rid of rtr fieldJeff Epler
2020-09-28canio: RemoteTransmissionRequest: Split implementation, keep one structureJeff Epler
This already begins obscuring things, because now there are two sets of shared-module functions for manipulating the same structure, e.g., common_hal_canio_remote_transmission_request_get_id and common_hal_canio_message_get_id
2020-09-28canio: Split RemoteTransmissionRequest to its own classJeff Epler
It reuses most of canio.Message's implementation, and structure
2020-09-28Match: address -> idJeff Epler
2020-09-28Merge pull request #3453 from DavePutz/issue3367Scott Shawcroft
Issue #3367 Changed delay calls to avoid conflicts with qspi_disable
2020-09-25Requested changes take 1Mark Roberts
2020-09-25Change I2C default to 100khzScott Shawcroft
Greater that 100khz is technically out of the original spec. Background here: https://github.com/adafruit/Adafruit_CircuitPython_CLUE/issues/36
2020-09-25Fixed page set mask to be four bits!Mark Roberts
2020-09-24Mostly-working-version with commentsMark Roberts
2020-09-22Removed redundant send of page settingMark Roberts