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

Add backlight dimming after timeout #17

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

Conversation

DJFliX
Copy link

@DJFliX DJFliX commented Jul 3, 2022

I implemented backlight dimming and added a few "registers" for configuring it (REG_ID_BK3 and REG_ID_BK4). I wasn't sure how much of the logic you wanted to expose in registers, so I decided to add some variables in backlight.h instead of bringing everything to the registers.

I'm running the changes on my board and it seems to be working as intended: disabling the timeout disables dimming. And changing the timeout does result in a dimmer backlight. I'm pretty sure the alarm/timing could be improved but I didn't want to fire too many events and risk getting in the way of other tasks.

@arturo182
Copy link
Contributor

Thank you for the submission, I'm a bit low on time right now so it might take a bit before I can have a proper look at this, but please know that it is appreciated :)

@DJFliX
Copy link
Author

DJFliX commented Jul 10, 2022

No worries! I noticed that the workflow failed because of multiple definition of last_triggered';` (as well as all the other variables I added). Somehow this didn't happen for me locally and I'm not entirely sure what causes it. I'll enable workflows on a different branch to see if I can identify and fix the issue there before I turn this branch into a mess.

Edit: ok, apparently I was using an outdated docker image (which had an older version of some key components in the compilation process). I've forked the docker image that I used and updated it. After that I was able to reproduce the issue I saw in the workflow on my machine. Then I decided to mimic the approach that I saw somewhere else in this project and introducing a struct named self inside of backlight.c (as opposed to defining the variables in backlight.h). I did take a course in c a long time ago and I thought declaring variables in header files was the norm back then. But maybe I'm mistaken 🤷. Anyhow, this seems to work 🤡

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