Skip to content

Commit

Permalink
Turn of display refresh, when powered off
Browse files Browse the repository at this point in the history
  • Loading branch information
gdyuldin committed Sep 30, 2024
1 parent e2d625e commit 2915201
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ void backlight_switch() {

on = false;
voice_say_text_fmt("Display off");
lv_disp_enable_invalidation(lv_disp_get_default(), false);
} else {
lv_disp_enable_invalidation(lv_disp_get_default(), true);
set_power(true);
set_brightness(params.brightness_normal);
x6100_gpio_set(x6100_pin_light, params.brightness_buttons == BUTTONS_DARK ? 0 : 1);
Expand Down
4 changes: 1 addition & 3 deletions src/band_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ void band_info_update(uint64_t f) {
bands = params_bands_find_all(f, width_hz / 2, &bands_count);
freq = f;

if (backlight_is_on()) {
lv_obj_invalidate(obj);
}
lv_obj_invalidate(obj);

if (!fade_run) {
fade_run = true;
Expand Down
4 changes: 0 additions & 4 deletions src/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ static void show_time() {
time_t now;
struct tm *t;

if (!backlight_is_on()) {
return;
}

if (params.clock_view == CLOCK_TIME_ALLWAYS) {
set_state(CLOCK_TIME);
} else if (params.clock_view == CLOCK_POWER_ALLWAYS) {
Expand Down
4 changes: 1 addition & 3 deletions src/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ void event_obj_check() {

if (item) {
if (item->event_code == LV_EVENT_REFRESH) {
if (backlight_is_on()) {
lv_obj_invalidate(item->obj);
}
lv_obj_invalidate(item->obj);
} else {
lv_event_send(item->obj, item->event_code, item->param);
}
Expand Down

0 comments on commit 2915201

Please sign in to comment.