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

Screensaver timeout #525

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

terratec
Copy link

Resolves #515

@WantClue WantClue added enhancement New feature or request good first issue Good for newcomers labels Nov 28, 2024
@@ -61,6 +61,7 @@ export class SettingsComponent {
this.form = this.fb.group({
flipscreen: [info.flipscreen == 1],
invertscreen: [info.invertscreen == 1],
screenTimeout: [info.screenTimeout, [Validators.required]],
Copy link
Contributor

Choose a reason for hiding this comment

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

I could be wrong, but I don't think it's needed here. There use to be more in settings, but think a lot got moved to the edit component and this may need to be cleaned up?

Copy link
Author

Choose a reason for hiding this comment

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

I guess you're right. There is no difference without this line (tested with "ng serve").
Should it be removed? Html is trial and error for me

Copy link
Contributor

Choose a reason for hiding this comment

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

Really this whole form (fb) should probably be removed as I don't think its needed in this file anymore. Shouldn't matter if you leave it or remove it, as the whole section should be cleaned up in a separate PR IMO

@terratec
Copy link
Author

What about the config-*.cvs files? Do they contain default values ​​for factory images?

@WantClue
Copy link
Collaborator

WantClue commented Dec 9, 2024

with moving over to LVGL shortly, can this be adapted?

@terratec
Copy link
Author

terratec commented Dec 9, 2024

with moving over to LVGL shortly, can this be adapted?

I'll look into it. We don't have a backlight with OLED, right?

[esp_lcd_panel_disp_on_off()] can turn on or off the LCD screen by cutting down the output path from the frame buffer to the LCD screen. Please note, this is not controlling the LCD backlight. Backlight control is not covered by the esp_lcd driver.

@terratec
Copy link
Author

terratec commented Dec 9, 2024

Here is a branch with LVGL (untested)
https://github.com/terratec/ESP-Miner/tree/lvgl_display_timeout

@mutatrum
Copy link
Contributor

mutatrum commented Dec 9, 2024

Take a look at https://docs.lvgl.io/9.2/overview/display.html#inactivity, there's already an inactivity timer built in, which resets automatically on any input, e.g. button press. I think it only needs to be checked in screen_update_cb in screen.c.

There's no backlight indeed.

@terratec
Copy link
Author

terratec commented Dec 10, 2024

Ah thank you!

Is it correct that we need our own timer to call lv_tick_inc? And we would be limited to uint32 with ~49 days of inactivity?

@mutatrum
Copy link
Contributor

Is it correct that we need our own timer to call lv_tick_inc? And we would be limited to uint32 with ~49 days of inactivity?

No, ticks are handled by the framework. Each lv_tick, screen_update_cb is called and the inactivity time in ms can then be retrieved by calling lv_display_get_inactive_time. Comparing to whatever configured timeout and the call to turn the display on or off should be done there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: configuration for screensaver timeout
4 participants