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

WIP: Add LED Alerts #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

WIP: Add LED Alerts #16

wants to merge 4 commits into from

Conversation

bpbradley
Copy link
Collaborator

Closes #14

This PR will implement local alert processing. Until #15 is merged and led notifications are added, this is all that can be done.

@bpbradley bpbradley self-assigned this Jan 26, 2022
…evice can control the alert directly.

Signed-off-by: Brian Bradley <[email protected]>
Signed-off-by: Brian Bradley <[email protected]>
@bpbradley
Copy link
Collaborator Author

Latest commits add the ability to override the led status directly. This would be used eventually by the bluetooth connected host to directly set the led color.

Instead of just allowing red / green / blue with 0/1/2 like the old firmware did, I am allowing any color to be set with a 24-bit hex value.

The override / release process should be thread safe, as access to the only variable which controls override is mutex guarded everywhere.

Right now, the alerts work exactly as the old system did -- an override takes precedence on the alert condition, and in the event of no override, an alert is generated locally by thresholding all the sensor values. In the locally generated alert, any over-threshold condition results in a solid RED led color.

Of course, this can be changed eventually, but I just reproduced the old behavior for now. It probably makes sense for there to be different alert colors, and perhaps for the led to blink (blinking will require a bit of a refactor, but that is expected).

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.

Add LED alerts
1 participant