Skip to content

Commit

Permalink
Merge branch 'hzeller:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vsumpi authored Dec 23, 2024
2 parents f561fa2 + 0ff6a69 commit 9e625fd
Show file tree
Hide file tree
Showing 37 changed files with 411 additions and 19,834 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: C/C++ CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [ push, pull_request ]

jobs:
build:
strategy:
matrix:
cython: [cython3-legacy, cython3]

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
- name: install cython
run: |
sudo apt-get update && sudo apt-get install -y ${{ matrix.cython }}
cython3 --version
- name: regenerate python bindings
run: make -B -C bindings/python/rgbmatrix
- name: make
run: make
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ Check out [utils/ directory for some ready-made tools](./utils) to get started
using the library, or the [examples-api-use/](./examples-api-use) directory if
you want to get started programming your own utils.

All Raspberry Pi versions supported
-----------------------------------
Raspberry Pi up to 4 supported
------------------------------

This library supports the old Raspberry Pi's Version 1 with 26 pin header and
also the B+ models, the Pi Zero, Raspberry Pi 2 and 3 with 40 pins, as well
as the Compute Modules which have 44 GPIOs.

The Raspberry Pi 5 still needs some research into the vastly changed peripherals
and is not yet supported.

This supports the old Raspberry Pi's Version 1 with 26 pin header and also the
B+ models, the Pi Zero, Raspberry Pi 2 and 3 with 40 pins, as well as the
Compute Modules which have 44 GPIOs.
The 26 pin models can drive one chain of RGB panels, the 40 pin models
**up to three** chains in parallel (each chain 12 or more panels long).
The Compute Module can drive **up to 6 chains in parallel**.
Expand Down Expand Up @@ -380,6 +384,20 @@ Use this also if you want to have a stable baseline refresh rate when using
the vsync-multiple flag `-V` in the [led-image-viewer] or
[video-viewer] utility programs.

```
--led-no-busy-waiting : Don't use busy waiting when limiting refresh rate.
```

This allows to switch from busy waiting to sleep waiting when limiting the
refresh rate (`--led-limit-refresh`).

By default, refresh rate limiting uses busy waiting, which is CPU intensive but
gives most accurate timings. This is fine for multi-core boards.

On single core boards (e.g.: Raspberry Pi Zero) busy waiting makes the system
unresponsive for other/background tasks. There, sleep waiting improves the
system's responsiveness at the cost of slightly less accurate timings.

```
--led-scan-mode=<0..1> : 0 = progressive; 1 = interlaced (Default: 0).
```
Expand Down Expand Up @@ -445,7 +463,7 @@ to debug if it has something to do with the sound subsystem (see Troubleshooting
section). This is really only recommended for debugging; typically you actually
want the hardware pulses as it results in a much more stable picture.

<a name="no-drop-priv"/>
<a name="no-drop-priv"></a>

```
--led-no-drop-privs : Don't drop privileges from 'root' after initializing the hardware.
Expand Down
2 changes: 1 addition & 1 deletion bindings/c#/examples/PlayGIF/PlayGIF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\RPiRgbLEDMatrix.csproj" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions bindings/c#/examples/PlayGIF/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using RPiRgbLEDMatrix;
using System.Runtime.InteropServices;
using Color = RPiRgbLEDMatrix.Color;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;

Console.Write("GIF path: ");
var path = Console.ReadLine()!;
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: This contains a lot of {c|p}ython build boilerplate, this needs cleanup.
PYTHON ?= python
PYTHON ?= python3
SETUP := setup.py
BUILD_ARGS := build --build-lib .
INST_ARGS := install
Expand Down Expand Up @@ -64,6 +64,7 @@ clean-python-%:
$(PYTHON)$* $(SETUP) $(CLEAN_ARGS)
else
build-python: $(RGB_LIBRARY)
$(MAKE) -C rgbmatrix
$(PYTHON) $(SETUP) $(BUILD_ARGS)

install-python:
Expand Down
15 changes: 3 additions & 12 deletions bindings/python/README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,12 @@ the hardware in question (see below for setting it via command line argument).

Then, in the root directory for the matrix library simply type:

### Python 2

```shell
sudo apt-get update && sudo apt-get install python2.7-dev python-pillow -y
make build-python
sudo make install-python
```

### Python 3
You can also build for Python 3:

```shell
sudo apt-get update && sudo apt-get install python3-dev python3-pillow -y
make build-python PYTHON=$(command -v python3)
sudo make install-python PYTHON=$(command -v python3)
sudo apt-get update && sudo apt-get install python3-dev cython3 -y
make build-python
sudo make install-python
```

### PyPy
Expand Down
2 changes: 2 additions & 0 deletions bindings/python/rgbmatrix/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
core.cpp
graphics.cpp
2 changes: 1 addition & 1 deletion bindings/python/rgbmatrix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Please check in modified *.cpp files with distribution to not require cython
# to be installed on the users' machine.
# for python3: make PYTHON=$(which python3) CYTHON=$(which cython3)
CYTHON ?= cython
CYTHON ?= cython3

all : core.cpp graphics.cpp

Expand Down
Empty file modified bindings/python/rgbmatrix/__init__.py
100755 → 100644
Empty file.
Loading

0 comments on commit 9e625fd

Please sign in to comment.