Skip to content

Add support for rgb control via lamp array (windows dynamic lighting)#49

Open
saad-script wants to merge 6 commits intoHandHeldLegend:masterfrom
saad-script:sinput-lamp-array
Open

Add support for rgb control via lamp array (windows dynamic lighting)#49
saad-script wants to merge 6 commits intoHandHeldLegend:masterfrom
saad-script:sinput-lamp-array

Conversation

@saad-script
Copy link
Copy Markdown

@saad-script saad-script commented Jan 16, 2026

This PR adds support for the lamp array protocol, commonly referred to as Windows Dynamic Lighting support. It’s important to note, however, that the protocol itself is open and not restricted to Windows. The spec can be found here.

Changes made:

  • added in a new animation mode RGB_ANIM_EXTERNAL.

    • In this mode, the animation handler will simply read and return the rgb data that is set by an external source.
    • the external source is flexible and can be used for any protocol (vendor define or lamp array). Though this PR only adds in the lamp array protocol.
    • How it works exactly: the external source 'queues' rgb data, and when the animation handler fires, it reads and returns this data.
  • Added in lamp array protocol:

    • lamp_array.h and lamp_array.c define all the behavior that follows the spec linked above.

Should be noted that this is only applied to sinput mode.

Tested and confirmed to work with windows dynamic lighting. Though it should be noted that for more advanced rgb effects, like rainbow waves, or gradients, the board_config.h of the target should define the device dimensions and rgb lamp locations. Simple rgb color control will work either way, but without the lamp location info, the advanced effects will not look accurate.

I already added the dimension and lamp position info into all the progcc targets (3, 3.1, 3.2).
I PRed this into the parent repo: HandHeldLegend/hoja-device-fw#7
I can add this positional info for all the other targets if this PR is something you would want to move forward with.

@saad-script
Copy link
Copy Markdown
Author

Also another note, though this PR seems pretty big (+500), most of that is from the lamp_array.h header file which just defines some structs and constants.

The actual logic which is in lamp_array.c is pretty straightforward and concise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion; for the width/height/depth, this should be standardized to a mm metric unit, or if it already is mm, just label it as such for clarity.

Copy link
Copy Markdown
Author

@saad-script saad-script Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, ill add in a comment here.
According to the specs its standardized to micrometers
(section 3.1 of the linked spec document has more info regarding this coordinate system)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants