Merged
Conversation
d4c9cc1 to
4fa2f12
Compare
4fa2f12 to
d00cb9e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds Python-facing support for writing LED ring colors by exposing the Crazyflie “LED driver” memory via the existing Memory subsystem, enabling easy per-LED color/intensity updates (e.g., for the LED ring deck).
Changes:
- Introduces a new
LedRingColorPython class (Rust#[pyclass]) and exports it through the Rust/Python module surface. - Adds
Memory.write_led_ring()async method to write exactly 12 LED values to LED driver memory. - Adds a new
examples/led_ring.pydemonstrating usage, and updates Python re-exports + type stubs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/subsystems/mod.rs | Re-exports LedRingColor from the memory subsystem. |
| rust/src/subsystems/memory.rs | Adds LedRingColor and Memory.write_led_ring() binding. |
| rust/src/lib.rs | Registers LedRingColor with the _rust Python module. |
| examples/led_ring.py | New example showing how to set individual LEDs and write to the ring. |
| cflib2/memory.py | Re-exports LedRingColor from the Rust extension module. |
| cflib2/_rust.pyi | Updates generated stubs for LedRingColor and Memory.write_led_ring(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gemenerik
requested changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes the led_driver memory for the LED ring deck and should be merged after this rust-lib PR is merged.
It is also affected by #4.