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

Fake brightness reimplementation #2444

Merged
merged 4 commits into from
Dec 26, 2024
Merged

Conversation

hackrfstuff
Copy link
Contributor

Hello. I know this may seem stupid, but a lot of people want this feature back. It was removed for performance issues, but I think that for the time being it does not have a big impact. The people that want it do not seem to mind. This is literally just the pull request that removed the feature, but the other way round.
Also, I thought that this may help individuals who are wanting to implement proper brightness, like through PWM (since they can just clone this).
I have tested it on my device, works like it did originally (no reason why it would not)

@gullradriel
Copy link
Member

gullradriel commented Dec 26, 2024

Indentation needs to be fixed.
And I would prefer that we call get_is_inverted(); and get_dark_cover(); get_brightness(); only once per screen refresh instead of at each pixels.
This will need little modifications, like caching the answer of these calls in the write lock function of the lcd file.
I think we should add static variables for get_is_inverted and get_dark_cover results in firmware/common/lcd_ili9341.hpp, and fill them once in the lcd_start_ram_write function in firmware/common/lcd_ili9341.cpp. or portapack_io.hpp/cpp
Then all calls to get_is_inverted, get_dark_cover, get_brightness should be replaced by their counterpart variable in the class.

@gullradriel gullradriel self-assigned this Dec 26, 2024
@gullradriel
Copy link
Member

I'm trying myself at caching the values. We will see.

Copy link
Member

@gullradriel gullradriel left a comment

Choose a reason for hiding this comment

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

That was good job by @zxkmm .
I only added a bit of caching, and it's running nice.
It's now back in the firmware.

@gullradriel gullradriel merged commit bad57d1 into portapack-mayhem:next Dec 26, 2024
3 checks passed
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