Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(flex-stacker): Bring up the internal/external status led bars and add gcode to control them. #495

Merged
merged 12 commits into from
Dec 17, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented Dec 16, 2024

Overview

The Flex stacker has 2 status-led strips of 4 LEDs each for 8, a is31FL3209 drives each strip-led driver. Each LED status bar can be addressed via I2C on addresses 0x6C for the internal strip and 0x6F for the external strip. This pull request brings up the i2c communication and uses the is31FL3209_driver.hpp and adds a ui_task.hpp that drives the heartbeat status led as well as the status bar state and controls.

Closes: EXEC-956

gcode SetStatusBarColor (M200) format

M200 P1 C0 K0
P = Power, float with values of 0 through 1.
0 Turns OFF the LEDs
0.1 - 1 Turns ON the LEDs to the given intensity.

C = Color, int with values 0 - 3
0: White
1: Red
2: Green
3: Blue.
NOTE: Sets the last color if omitted.

K = kind, int with values 0 or 1
0 = internal status bar
1 = external status bar.
NOTE: Sets both if omitted

Examples:

M200 P1 C1 K0 \r\n
Turns ON (P1) the Internal (K0) status bar to the color red (C1)

M200 P0
Turns OFF (P0) both status bars (K omitted) to the last color (C omitted)

Change log

  • Sets up i2c communication setup and usage via the i2c::hardware::I2C class
  • Adds a UIPolicy class to provide i2c comms and heartbeat LED toggles to the UITask
  • Adds a UITask class which is responsible for managing and controlling the heartbeat led on the board and the status bars.
  • Adds a SetStatusBarColor (M200) gcode that can set one or all status bar leds and power

Testing

  • Test on the flex and make sure we can address both the internal / external led strips using the SetStatusBarColor (M200) gcode.

Reviewer Request

Anything I'm missing?

@vegano1 vegano1 requested a review from ahiuchingau December 16, 2024 20:33
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

lgtm, though you might want something where you can set channels numerically for testing

Copy link
Contributor

@ahiuchingau ahiuchingau left a comment

Choose a reason for hiding this comment

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

Implementation looks good to me.

Can we disable setting the color to red when there's an error/a stall for now (so it doesn't do that for slas)?

@vegano1
Copy link
Contributor Author

vegano1 commented Dec 17, 2024

lgtm, though you might want something where you can set channels numerically for testing

Sounds good, will add in a follow-up pr.

@vegano1 vegano1 merged commit a4f1652 into edge Dec 17, 2024
12 of 13 checks passed
@vegano1 vegano1 deleted the flex-stacker-ui-leds-bringup branch December 17, 2024 16:42
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.

3 participants