summaryrefslogtreecommitdiff
path: root/shared-module/rgbmatrix/RGBMatrix.c
AgeCommit message (Collapse)Author
2021-03-15run code formatting scriptmicroDev
2021-02-12Enable protomatter on RP2040 buildsJeff Epler
Also found a race condition between timer_disable and redraw, which would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable or put a delay or print inside it. That's what pausing inside reconstruct fixes. So that the "right timer" can be chosen, `timer_allocate` now gets the `self` pointer. It's guaranteed at this point that the pin information is accurate, so you can e.g., find a PWM unit related to the pins themselves. This required touching each port to add the parameter even though it's unused everywhere but raspberrypi.
2021-01-26rgbmatrix: Eliminate some duplicated height-calculating codeJeff Epler
This was hard to write, so let's have it written in 2 places instead of 4.
2021-01-26RGBMatrix: Additional tile tweaksJeff Epler
* Introduce explicit serpentine: bool argument instead of using negative numbers (thanks, ghost of @tannewt sitting on one shoulder) * Fix several calculations of height Testing performed (matrixportal): * set up a serpentine 64x64 virtual display with 2 64x32 tiles * tried all 4 rotations * looked at output of REPL
2021-01-26protmatter: Update to version that supports tilingJeff Epler
2020-11-28Use movable allocation system for RGBMatrix allocations.Christian Walther
Hybrid allocation is now part of the infrastructure. Moving memory contents would not be necessary because displayio can recreate them, but does not hurt.
2020-11-28Add movable allocation system.Christian Walther
This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap. By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review.
2020-10-12Merge pull request #3537 from jepler/update-protomatter-2Scott Shawcroft
rgbmatrix: update protomatter to 1.0.5 tag
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-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-09-02rgbmatrix: Move struct definition to shared-module, rename 'core' memberJeff Epler
2020-09-01RGBMatrix: Remove unused, dead allocationJeff Epler
@tannewt noticed this in a pull request review. The allocated memory was never used, but the GC would have collected it eventually.
2020-09-01rgbmatrix: Disable timer while reconstructing the displayJeff Epler
2020-09-01rgbmatrix: Don't inline the allocator functionsJeff Epler
2020-09-01rgbmatrix: recover gracefully from allocation errorsJeff Epler
e.g., allocating a 192x32x6bpp matrix would be enough to trigger this reliably on a Metro M4 Express using the "memory hogging" layout. Allocating 64x32x6bpp could trigger it, but somewhat unreliably. There are several things going on here: * we make the failing call with interrupts off * we were throwing an exception with interrupts off * protomatter failed badly in _PM_free when it was partially-initialized Incorporate the fix from protomatter, switch to a non-throwing malloc variant, and ensure that interrupts get turned back on. This decreases the quality of the MemoryError (it cannot report the size of the failed allocation) but allows CircuitPython to survive, rather than faulting.
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-04-17RGBMatrix: finish renaming from ProtomatterJeff Epler
This gets all the purely internal references. Some uses of protomatter/Protomatter/PROTOMATTER remain, as they are references to symbols in the Protomatter C library itself.
2020-04-17Rename Protomatter -> RGBMatrixJeff Epler
This is a quick rename, it changes the user-facing names but not the internal names of things.